Hi!
I have a form that I'm using for file uploads. You fill out your company name and browse for a file that is then uploaded onto the server. Since I've put in my script to only accept files from people who've filled out their company name, people who try to send very large files (that may take 15-20 minutes to load), and forgot to put in their company name, they'll get an error after the 15-20 minutes that they didn't fill out the company name, and have to start from scratch.
What I'm looking for here is basically something to stop the script from reading the file upload part (which is a regular browse button <input type="file" in the form) unless the company name text field is filled in. I've tried putting the upload part last, or into an if else condition (i.e. if company name not empty only then upload else exit) but nothing seems to stop it from reading and trying to copy the uploaded files.
I guess I can do it with Javascript, but I wonder if server side would work.
I have a form that I'm using for file uploads. You fill out your company name and browse for a file that is then uploaded onto the server. Since I've put in my script to only accept files from people who've filled out their company name, people who try to send very large files (that may take 15-20 minutes to load), and forgot to put in their company name, they'll get an error after the 15-20 minutes that they didn't fill out the company name, and have to start from scratch.
What I'm looking for here is basically something to stop the script from reading the file upload part (which is a regular browse button <input type="file" in the form) unless the company name text field is filled in. I've tried putting the upload part last, or into an if else condition (i.e. if company name not empty only then upload else exit) but nothing seems to stop it from reading and trying to copy the uploaded files.
I guess I can do it with Javascript, but I wonder if server side would work.