This is what I did to be able to limit the size of the images that people can upload (using PHP):
In the edior/filemanager/browser/default/frmupload.html
Add this case to the switch ( errorNumber ) block:
***
case 203 :
alert( 'File Too Large! Resize the file before trying to upload.' ) ;
break ;
***
also in In the edior/filemanager/browser/default/frmupload.html
after this line:
<form id="frmUpload" action="" target="frmUploadWorker" method="post" enctype="multipart/form-data" onsubmit="return OnSubmit();">
*
ADD( set the value to the size you would like in bytes):
*
<input type="hidden" name="MAX_FILE_SIZE" value="200000">
***
In editor/filemanager/browser/default/connectors/php/commands.php
after this line - if ( isset( $_FILES['NewFile'] ) && !is_null( $_FILES['NewFile']['tmp_name'] ) )
{
*
ADD:
*
if ( ($_FILES['NewFile']['error'] == 1 ) || ($_FILES['NewFile']['error'] == 2 )) $sErrorNumber = '203' ;
In the edior/filemanager/browser/default/frmupload.html
Add this case to the switch ( errorNumber ) block:
***
case 203 :
alert( 'File Too Large! Resize the file before trying to upload.' ) ;
break ;
***
also in In the edior/filemanager/browser/default/frmupload.html
after this line:
<form id="frmUpload" action="" target="frmUploadWorker" method="post" enctype="multipart/form-data" onsubmit="return OnSubmit();">
*
ADD( set the value to the size you would like in bytes):
*
<input type="hidden" name="MAX_FILE_SIZE" value="200000">
***
In editor/filemanager/browser/default/connectors/php/commands.php
after this line - if ( isset( $_FILES['NewFile'] ) && !is_null( $_FILES['NewFile']['tmp_name'] ) )
{
*
ADD:
*
if ( ($_FILES['NewFile']['error'] == 1 ) || ($_FILES['NewFile']['error'] == 2 )) $sErrorNumber = '203' ;
RE: Limiting size of uploaded images - Solved
RE: Limiting size of uploaded images - Solved
Great! It works perfectly