Do you want to allow users to upload files on your site? WPForms’ file upload feature allows you to easily collect files and media through your online forms. In this guide, we’ll answer all of your questions about the file upload feature in WPForms.
- How Do I Create a File Upload Form?
- Can Users Upload Multiple Files?
- What’s the Difference Between “Modern” and “Classic” Styles?
- What File Types are Allowed for Upload?
- How Do I Restrict File Types?
- What is the Maximum File Size Allowed for Uploads?
- How Do Notifications Work With File Uploads?
- Where Are Uploaded Files Stored?
- Will Uploaded Files Be Compressed?
How Do I Create a File Upload Form?
WPForms makes it easy to accept files from your website visitors. All you need to do is add the File Upload field to your form with just a single click. Or you can even drag and drop the field to your desired location.
For a step-by-step guide, you can check out how to create a file upload form.
Can Users Upload Multiple Files?
You can absolutely allow multiple files to be uploaded to your forms (even within a single File Upload field). You’ll need just a couple of steps to set this up.
First, open up the form builder and make sure that you’ve added a File Upload field. Then, go ahead and click on this field to open its Field Options panel.
Next, you’ll need to check that your File Upload field is set to allow multiple files. To do this, you’ll need to click on Advanced Options to open it. In the Style dropdown, be sure to select the Modern option. This style is required before you can allow more than one file to be uploaded.
When the Modern style has been chosen, you’ll see a Max File Number option. By default, this field will be set to 1, but you can increase this as needed.
Note: If you’re unsure whether your site’s hosting environment can properly handle the number of files you’d like to upload, be sure to do some testing before launching your form. You can also consider reaching out to your site’s hosting provider for their advice on uploads.
What’s the Difference Between “Modern” and “Classic” Styles?
If you read through the answer above, or if you’ve dug around in the File Upload options, then you’ve likely noticed that the File Upload field has two different style options.
To view these options, you’ll need to open the form builder and click on the File Upload field to see its Field Options. Then, click on the Advanced Options section.
The Advanced Options include a Style dropdown, and here you can choose between Modern and Classic. We’ll share details about each of these options below.
The File Upload field’s Modern style displays a drag-and-drop box. When a visitor uses your form, they can either click on this field to select files from their device, or they can drag files into the box to begin the upload process.
Modern style also optionally allows multiple files to be uploaded to a single File Upload field.
Additionally, this style uses AJAX uploading. Uploading files, especially large files, can demand a lot of resources from your site’s hosting server, and that can result in a delay when the form submits. However, AJAX uploading gets a jumpstart on this upload process to allow your forms to submit faster.
Note: Your site must be loaded over a secure SSL (https) connection in order for files to completely upload. If your site is loading over an insecure (http) connection, files won’t properly upload and the form won’t submit. Your site’s host can easily update your connection to SSL, so be sure to get in touch with them if you run into this error!
The File Upload field’s Classic style displays a Choose File button. When a visitor uses your form, they can either drag a file onto this button or click the button to select a file from their device.
What File Types are Allowed for Upload?
Security is a huge priority for us at WPForms, so we restrict file types to safe files only (the same file types allowed by WordPress core). These are:
- Images like .png, .gif, .jpg
- Documents such as .doc, .xls, .ppt, .pdf
- Audio like .wav, .mp3, .mp4
- Video like .mpg, .mov, .wmv
If you’s like WPForms to support more file upload types, please take a look at how to allow users to upload more file types.
How Do I Restrict File Types?
To restrict file extensions, click on the File Upload field in the form builder. In the Field Options panel there will a field called Allowed File Extensions. Here, you can specify the extensions you’d like to allow, separated by a comma.
What is the Maximum File Size Allowed for Uploads?
To find the maximum allowed file size, you can click on the File Upload field in the form builder. Then, from the Field Options panel, click the tooltip next to the Max File Size field. This tooltip will show the maximum file size that your server allows.
You can limit the allowed file size by specifying the size in the Max File Size field.
Note: If you’d like to increase the file upload size of your site, you’ll need to reach out to your hosting provider to find out if it’s possible. For more details, you can check out WPBeginner’s tutorial on increasing the maximum file upload size in WordPress.
How Do Notifications Work With File Uploads?
When a user submits a form with an uploaded file, you’ll receive email notifications with a link to that file. This means you can quickly view or download the file without having to log into your WordPress dashboard.
Note: Why do we use links instead of attachments? Since file attachment can often hurt email deliverability, currently we don’t attach files on emails. For example, if an email provider only allows a maximum of 10MB attachment but the user uploads a file size higher than 10MB, the email won’t be delivered.
Where Are Uploaded Files Stored?
By default, the user-uploaded files are stored in the WPForms folder inside the Uploads directory of your site.
If you’d prefer to upload the files to the WordPress Media Library, click on the File Upload field in the form builder. Then, under Advanced Options, check the box next to Store file in WordPress Media Library.
No matter where you store your files, they can always be accessed in the Entries of your form, by clicking the link within an individual entry.
Will Uploaded Files Be Compressed?
WPForms will not compress any files that are uploaded. However, if you choose to store your files to the WordPress Media Library, then WordPress will automatically compress your images.
Note: If you would like to optimize your images before uploading them to your site, then check out WPBeginner’s tutorial on how to easily optimize images for performance.
That’s it! We’ve just covered the most common questions about using the file upload field in WPForms.
If you found this article useful, you might also want to check out how to create conditional form notifications in WordPress.