Validation rules of file |
HI , i have a problem with a file validation rule :
this is my file in form : Code: <input type="file" name="immagine_logo" class="form-control-file"> Code: 'immagine_logo' => [ and this the dd of file Code: $_FILES array (1) The error is : immagine troppo pesante massimo 3MB if i move max_size after ext_in i have the other error: Formato supportato : jpg,jpeg,gif,png.webp Which is the error ?
The file exceeds 3 MB - there may be a limitation in PHP. Edited in php.ini
tmp_name empty. File not uploaded to server. May be there problem? Check writable folder on access "chmod 777"
In your $_FILES array, when you upload the image, the error code is 1, which means "UPLOAD_ERR_INI_SIZE". This means the uploaded file exceeds the upload_max_filesize directive in php.ini. Update that otherwise "max_size" will fail.
On "ext_in" error, since the file was not uploaded because of the size problem, the validator cannot check the extension since the file is missing. Thus, it errors.
php.ini
post_max_size = 256M upload_max_filesize = 256M What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |