WordPress Tutorials, Tips, and Resources to Help Grow Your Business
Do you want users to be able to add multiple attachments to your contact form? WPForms makes front end file uploads easy – no need for a separate WordPress file upload plugin. In this article, we’ll show you how to allow multiple file uploads using WPForms.
Allowing WordPress Multiple File Uploads
Providing your users the ability to upload a file in your WordPress forms makes it easier for you to collect the information you need. You can allow users to upload different file formats including .doc, .xls, .csv, .pdf, an image file, or even an audio / movie file.
By default, WPForms allows you to upload only a single file with a File Upload field. To allow multiple file uploads, you can simple add as many file upload fields as you need to.
But, what if you want to allow multiple file uploads without displaying all those fields to every user?
There’s a way to do this with WPForms conditional logic, by allowing your users to choose the amount of files they would like to upload.
Let’s take a look at a step by step guide to allow WordPress multiple file uploads.
Create Your File Upload Form
After activating the plugin, go ahead and create a file upload form in WordPress.
Allow Multiple File Uploads
Then, above the file upload field, add a Dropdown field where each option is a number. Let’s rename the field to Number of Files to Upload. You can include the full range of possible numbers of upload fields.
For the sake of this example, let’s allow users to upload a maximum of 3 files in your form.
Now click on the File Upload field and rename the field to Upload Your File. Then, let’s enable conditional logic. Based on user selection, we need to show multiple file upload fields in our form.
To do this, configure your conditional logic fields just like the screenshot below.
Keep in mind that new fields are added by clicking the Add new group button, which applies OR logic.
If you need more details about using OR logic, read how to use And OR conditional logic.
In the above step, we’ve just created a field that will display with every single number that gets selected.
Now duplicate this field by clicking the double paper icon on the right hand side of the Upload Your File field.
Configure the conditional logic fields just like the screenshot below. The only change from the above step is that we removed the first field where it says the Number of Files to Upload is 1. Let’s rename the new field to Upload Your Second File.
Again, copy the second File Upload field by clicking the double paper icon. Configure the conditional logic field just like the screenshot below. Let’s keep only the last field where it says the Number of Files to Upload is 3. Let’s rename the new field to Upload Your Third File.
Now save the form you just created.
You can continue this process for every other possible number. The only thing you need to take care is to duplicate the previous field, then remove the lowest number’s conditional logic.
You’ve just created a multiple file uploads form in WordPress.
If you enjoyed this article, you might also want to look at some cool contact page design examples.
What are you waiting for? Get started with the best WordPress forms plugin today.