How to restrict image upload maxsize to 2MB in CKEditor? -
i working on requirement of upload image in 'ckeditor' image uploaded should below 2mb size. using 'ckfinder' image upload, know there 'maxsize' option images in 'ckfinder\config.php' file, maxsize=0 there have changed '2000' , after tried upload image above 2mb still accepting image upload. observed here happening whenever user uploads image in ckeditor is doing image compression automatically , 2mb or above image getting compressed kb's. below code of config.php file:
ckeditor/ckfinder/config.php
$config['resourcetypes'][] = array( 'name' => 'images', 'directory' => 'images', 'maxsize' => 2000, 'allowedextensions' => 'bmp,gif,jpeg,jpg,png', 'deniedextensions' => '', 'backend' => 'default' );
ckeditor/config.js
ckeditor.editorconfig = function( config ) { config.filebrowserbrowseurl = "/ckeditor/ckfinder/ckfinder.html"; config.filebrowserimagebrowseurl = "/ckeditor/ckfinder/ckfinder.html?type=images"; config.filebrowserflashbrowseurl = "/ckeditor/ckfinder/ckfinder.html?type=flash"; config.filebrowseruploadurl = "/ckeditor/ckfinder/core/connector/php/connector.php?command=quickupload&type=files"; config.filebrowserimageuploadurl = "/ckeditor/ckfinder/core/connector/php/connector.php?command=quickupload&type=images"; config.filebrowserflashuploadurl = "/ckeditor/ckfinder/core/connector/php/connector.php?command=quickupload&type=flash"; config.language = "en"; config.uicolor = "#f7b42c"; config.height = 300; config.toolbarcancollapse = true };
my questions here are, confused of whether 'maxsize' in kb's or mb's in config.php file? how restrict image maxsize allow images equals or below 2 mb in ckeditor? appreciated. thanks.
you may refer ckfinder php connector official docs on resourcetypes
:
the maximum size of uploaded image defined in bytes. shorthand notation supported: g, m, k (case insensitive). 1m equals 1048576 bytes (one megabyte), 1k equals 1024 bytes (one kilobyte), 1g equals 1 gigabyte.
this question have been answered on ckeditor github issue page.
Comments
Post a Comment