Probably it's running into a webserver limitation (either an nginx/apache setting or a php setting) that doesn't allow files larger than 10mb to be uploaded at all. So the validation doesn't get a file to validate basically.
10mb file validation problem
This is a strange problem for me. i'm validating file with max:5000 . Then i'm uploading a file of size 9,980kb it gives the error "Allowed file size is 5000" which is perfectly fine. but when im uploading a file of size 10,367kb (more then 10mb), it does give me error but like this "The std file failed to upload". I mean i have a custome message right there, but its not showing that on 10mb file,
$validator = Validator::make($request->all(),[
'std_file'=>['required','file','max:5000'],
],[
'std_file.required' => "Please Select a File to Upload",
'std_file.file' => "Invalid file type",
'std_file.max' => "Allowed file size is :max",
]);
The upload becomes truncated if it exceeds the post_max_size and then some of the other content of the POST request gets left off. Results can be unpredictable.
Note that you need to allow for the file being base64 encoded also so will be larger in transmission than you see in the file size on your computer. (about +33%)
Please or to participate in this conversation.