Forum
Error in form not working
I'm trying to add error messages to a Perch form, I've adde successfully to all text, email, number fields.
But in the file upload field, the "fileupload" isn't working?
When adding
<perch:error for="cv" type="filetype">
<span class="error">File must be a PDF or Office document.</span>
</perch:error>
<perch:error for="cv" type="fileupload">
<span class="error">Couldn't upload the file - could be too big.</span>
</perch:error>
"filetype" works correctly, but when I try to upload a file that's to big. The form just get's reset?
Which PHP setting are you exceeding?
From the diagnostics: PHP limits: Max upload 20M, Max POST 10M, Memory: 99M, Total max file upload: 10M
And my php.ini file its set to:
How big is the file you're uploading?
I've tried one that's 20,5 mb and one that's 105 mb.
Both of them result in the browser starting to upload the file, then after a while it just resets all fields in the form.
You're hitting the
post_max_size
setting, so the form is never handed to Perch to process. PHP just kills the request.The
post_max_size
setting should be larger than theupload_max_filesize
setting in normal use.I've made the following changes, but the same thing happens. It loads for a while before it resets the form.
If the form is just resetting then the post isn't getting as far as Perch.
Not sure, it does't show up in the perch admin nor does it show up in my inbox.
That wasn't a question - Perch isn't getting the data so the error can't display. You should look to your hosting settings.
Any idea what should I look for?
That's really beyond what I'm equipped to help with.