Use Formidable Forms Pro to protect your gated content file downloads and offer a download file on submit. Gated content is content that can only be accessed by users who submit your form. This ensures that only people who have paid for the content (via your form) or submitted the required form to access the content (such as a lead generation form) can access the content. Formidable will protect your content so it can't be illicitly shared with others.
Step 1: Create a Form to Protect the Files
- Create a new form and name it Protected Files.
- Add a Single Line Text field and name it File Name. Set this field to be required and unique.
- Add a File Upload field. Click the Update button to save the form.
- Go to your form Settings → Form Permissions page and select the Protect all files uploaded in this form checkbox.
- Click the Update button to save the form settings.
Step 2: Create a View to Display the Protected Files
- Create a new View and name it Display Protected File.
- In the Advanced Settings, set the limit to 1 to display a Single Entry.
- In the Listing Page Content Box, select the Text tab and enter the following HTML:
<a href="">Open </a>
- Replace 28490 with the File Upload field ID.
- Replace 28489 with the File Name field ID.
- Add a filter to the Advanced Settings of the View:
- File Name equal to [get param=filename default=0]
- Save the View by clicking the Update button.
Step 3: Display the download file after form submission
- Go to your existing form, or create a new one. Once in the form, go to the Form Settings.
- Set the Form to Show a Message on submit.
- Insert the View shortcode in the Messages → On Submit box.
[display-frm-data id=6682 filename="Test File"]
- Replace 6682 with the ID of your View.
- Replace the Test File with the file name you have submitted in the form. Note: The entry's filename should match the submitted entry, or the download link will not be displayed.
- Finally, update your form, and you are done!