Uploading Files to your Web Forms
Very often customers with web site forms would like their users to be able to upload images or other files along with all of the rest of the form data that will be submitted. These files could be anything, really:
- Music files
- Patient X-rays
- New software
- Screen shots
Uploading files from a web form is a two-part process. First, you need to properly configure your form. Second, you need to properly collect those files on the server.
Configuring your Web Form for File Uploads
In order for your web form to have file uploads, you need to update your <form …> tag with a special parameter that tells the web browser to send the file data along with the rest of the form data. If you leave this out, the files will not be sent. Update your
<form name=”form_name” action=”target_url” method=POST>
<form name=”form_name” action=”target_url” method=POST enctype=”multipart/form-data”>
E.g. add the new “enctype” parameter and be sure that the “method” is “POST” and not “GET”.
Next, you can put the form fields in your form where you want the file upload boxes to appear:
<input type=file name=file_field1>
This produces a file browsing box that users can click on and select a file from their computer. If the user does this and the form is submitted, then the file will be sent to the server along with your form data.
Preparing your Server for File Uploads
When the files arrive at your server, you need to be sure that:
- Your server is configured to accept files … and of the size that you need to accept. Many servers, especially ones running PHP, will have strict limits on the maximum size of file uploads.
- Your server software is looking for the uploaded files.
You need to program your form processing software to properly save and handle these files. Most basic email-to-form software does not handle uploaded files.
Uploaded Files with LuxSci SecureForm
A quick and easy way to be sure that your files are processed is to use LuxSci SecureForm as the back end to collect your form data. It supports:
- Up to 25 files uploaded per post
- Up to 50MB total data uploaded per post
Additionally, it is pre-configured to properly handle the files and deliver them to you automatically in any of these ways:
- Emailed to you as email attachments (encrypted if needed)
- Uploaded to your server via FTP or SFTP
- Saved in our online WebAides file storage area
With SecureForm, you can be receiving files in minutes … as soon as you can make the needed updates to your web form.
- Auto-upload web and PDF form post data to your FTP/SFTP site with SecureForm
- Can your web and PDF forms save to an Encrypted Database?
- Get your Web or PDF form data any way you want it
- Case Study: Managers Fill in Web Forms Nightly; You Download the Data in a Spreadsheet
- Web and PDF Form Submissions Saved to a MySQL Database