nsvetozarevic's avatar

Validate file size when php.ini or nginx max file size is exceeded

When uploading files, I have set the limit of the file size to 20mb. It works good, larger files are returned as an error. But, the strange thing happens when user tries to upload a super large file, bigger then it's allowed by php.ini or nginx server settings. We get a nginx error... Now that tells me that laravel file size validation comes after a file is uploaded to a temp doc... But that would be bad, right?

I know that I could include FE validation, and ensure that files are not even sent to the backend, but I'm interested in the backend side... Did someone encounter this, and what would be the solution?

0 likes
1 reply

Please or to participate in this conversation.