Collect contact name and email before file download
In some instances, you may want to collect your contact’s name and email address before allowing a file download. Here is one method I use, which requires the zem_contact_reborn plugin.
- Download the zem_contact_reborn plugin
- Install and activate
In an article (write tab), enter the following:
<txp:zem_contact mailto="your_email@example.com" thanksform="file_download">
<txp:zem_contact_text label="Name" />
<txp:zem_contact_text label="Organisation" />
<txp:zem_contact_email />
<txp:zem_contact_submit label="Get File />
</txp:zem_contact>
Place the above code in your article and save. Change the email address to your own.
Create the file_download form
You may download your file by clicking <a href="http://yoursite.com/file_download/6" title="some title">HERE</a>.
Create the form as type misc and save. Edit according to your requirements, and be sure to change the file id number.

Ryan Gardner
# 19 March 2009
Great tip! I have a client who wanted this, but didn’t want people to have to click on the link to download the file — just wanted to have it download as soon as the user submitted the form. So I worked a little magic with the great smd_if plugin.
I did this before txp:variable came around so this might be possible without the smd_if plugin …
In the article the first line of the zem_contact plugin specify the file you want to download like this:
Then I created a section called “download” with this code between the <head> and </head> tags:
Then, just for good measure, I put the download link down in the body of the page just in case the user’s browser doesn’t refresh:
I’m sure this could be refined, but it seems to work well.