Limit upload to 5MB
This commit is contained in:
@@ -28,8 +28,8 @@ class Upload extends Controller
|
||||
// Valid File Extensions
|
||||
$valid_extension = array("jpg","jpeg","png");
|
||||
|
||||
// 2MB in Bytes
|
||||
$maxFileSize = 2097152;
|
||||
// 4MB in Bytes
|
||||
$maxFileSize = 5000000;
|
||||
|
||||
// Check file extension
|
||||
if(in_array(strtolower($extension),$valid_extension)){
|
||||
@@ -54,7 +54,7 @@ class Upload extends Controller
|
||||
$image->save( $thumbdir.'/'.$bckfile);
|
||||
echo 'Upload Successful.';
|
||||
}else{
|
||||
echo 'File too large. File must be less than 2MB.';
|
||||
echo 'File too large. File must be less than 5MB.';
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user