FormBuilder - Check File Upload Size

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
asayama
New Member
New Member
Posts: 6
Joined: Fri Dec 26, 2008 6:07 pm

FormBuilder - Check File Upload Size

Post by asayama »

Hey folks, was wondering if anyone had any advice with checking file size limits on files uploaded through FormBuilder before submission. For example, to prevent folks from uploading 1GB files and having the form time out, check on submit that the post size is less than 8MB or whatever. I have a UDT that will check the length of the POST data, but figuring out where to actually call it in relation to the FormBuilder setup is eluding me. I can't put it in the submission template because that's for successful submissions, I can't choose it from the dropdown for Form Submission Behavior because that appears to be pre-post.

Any advice?
janaf
Forum Members
Forum Members
Posts: 183
Joined: Sun Jan 10, 2010 7:02 pm

Re: FormBuilder - Check File Upload Size

Post by janaf »

$config['max_upload_size'] =
in the config.php file

Size is set in bytes, ie 10000000 for appr 10MB
asayama
New Member
New Member
Posts: 6
Joined: Fri Dec 26, 2008 6:07 pm

Re: FormBuilder - Check File Upload Size

Post by asayama »

Unfortunately that doesn't really fix the issue. By setting the max file size, when the form submits with FormBuilder but still seems to process the whole file data only to then return to the empty form with no error message. So while the file is too large and does not get uploaded, the FormBuilder behavior is incorrect :(

Ultimately we could rewrite the form using flat html and php, directly, but we were hoping to make use of the FormBuilder module since that module is used for all the other forms on our site. Just this one stickler point to get around! :)
janaf
Forum Members
Forum Members
Posts: 183
Joined: Sun Jan 10, 2010 7:02 pm

Re: FormBuilder - Check File Upload Size

Post by janaf »

Are you using the Form builders "File Upload" field? It has a

"Maximum upload file size (kilobytes)":
"This limitation is in addition to any limits set by the php or web server configuration"
asayama
New Member
New Member
Posts: 6
Joined: Fri Dec 26, 2008 6:07 pm

Re: FormBuilder - Check File Upload Size

Post by asayama »

Yup, that's what we're using. With that, we can select a 200MB file, hit upload, and after a loooooooooong wait, it will finally go back to the page with all the fields emptied out and no error message. That I don't care as much about. The thing I do care about is that instead of actually processing all that data before refreshing, I wish it would see that there is too much data from the start and throw an error immediately before hanging a user's browser :(
Post Reply

Return to “Modules/Add-Ons”