Download PDF on form submission
-
I want the user to be able to download a PDF file after registering on the site with a simple ‘Name’ and ‘Email’ form.
Is this possible with Contact Form 7? I have tried to combine with other plugins to achieve this but not been successful. I have also tried with the following code but no had any luck:
.htaccess file:
<FilesMatch "\.(?i:pdf)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch>
functions.php:
function mycustom_wp_footer() { ?> <script type="text/javascript"> document.addEventListener( 'wpcf7mailsent', function( event ) { if ( '1497' == event.detail.contactFormId ) { window.open( 'https://stagingarea2.craigsapsford.com/wpcontent/uploads/dlm_uploads/2017/11/Test-Document.pdf' ); } }, false ); </script> <?php }
Can anyone assist me with this?
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Download PDF on form submission’ is closed to new replies.