You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #15166 broke my file upload. I dug into the code and found out that is_uploaded_file() in isValid() returns false when being invoked from within the Validator with the changed code from the PR.
I don't seem to understand your issue, using your code on a fresh laravel 5.3 installation works for me, uploading 3 valid files passes, uploading any invalid files fails with the correct message.
It's not clear what your issue is, is it because the guessed extension is not correct at your end?
Okay, I'm closing this since I've got it working by validating all files before uploading them in my foreach loop. I still don't understand why, when I upload two files, the validation of the second file results in an "uploaded" error ("uploaded" rule failing). I guess it must have two do with the upload of the two interfering each other somehow.
Somehow, is_uploaded_file() returns false for the second file in the loop.
Description:
PR #15166 broke my file upload. I dug into the code and found out that
is_uploaded_file()
inisValid()
returnsfalse
when being invoked from within theValidator
with the changed code from the PR.Steps To Reproduce:
This is a part of my code:
Output:
So I can see the mime rules are failing.
If I
var_dump()
the guessed extension of the$file
by callingvar_dump($file->guessClientExtension()); die();
I correctly getjpeg
.I also tried calling
$validator->setFiles([...]);
but that didn't help either.The text was updated successfully, but these errors were encountered: