I want to validate my uploaded file (image/doc/pdf/xls etc) for file size through model. The uploaded file should be less than 2 mb and document type can be either jpeg or pdf. Can anyone please help me through this . I am really struggling through this.
Yes it does. But it throws error in case of fileSize() as:
filesize(): stat failed for c:\xampp\tmp\php3f06.tmp [core\src\validation\validation.php, line 1297.
That usually means that PHP can’t access the file, which seems curious if mime-type checking works. But I have no clue about PHP on Windows.
Do you move away the file manually before the validator can pick it up? I would go to said line, pause the execution there and check that the tmp file does actually exist.