Force download on Thank You Page

Stephen_Jeong1
Level 3

Force download on Thank You Page

Hello

I would like for a lead to be led to a thank you page after they fill out a form but I want the pdf to automatically download when they get to the thank you page rather than being directed to the url of the pdf. 


I know that many people suggest sending an email with the asset rather than providing the asset immediately but I would like to test which one works better in terms of engagement.

Does anyone know what custom html I would use to make this happen? 

Thanks
Tags (1)
3 REPLIES 3
Anonymous
Not applicable

Re: Force download on Thank You Page

A lot of web browsers block this, so I'm not sure this is really a best practice. I'd recommend having a big, visible link instead.
Anonymous
Not applicable

Re: Force download on Thank You Page

I like that you are taking a data-driven approach to figuring out what works best. But as Erik mentioned, this is prevented by all modern broswers will block this for security reasons. 

The best workaround is trigger a download by click a link. Try this:
<a href="path_to_file/example.pdf" download="proposed_file_name.pdf">Download</a>
 

Anonymous
Not applicable

Re: Force download on Thank You Page

Stephen, interesting approach, but why not just redirect people to the URL after submission?

You could do a 301 redirect but not sure how that would change things.

As others noted, browsers block this because many sites might try to do this to send viruses.