Umesh Awasthi
Umesh Awasthi

Reputation: 23587

Save/[Save As] dialogue box on download using wordpress

I am trying to develop a functionality and I need to offer user a PDF to download. I am able to do in successfully to some extend, like user will get a email with download link like

http://www.abc.com/balbla.pdf

But this is opening up the PDF in the browser window, I am thinking of offering a way so that when user click on the link he/she should be prompt to save it using standard save/save as box

How can this be done in WordPress?

Upvotes: 2

Views: 999

Answers (2)

Ms. Hsu Mon Mon San
Ms. Hsu Mon Mon San

Reputation: 11

The simple way is so easy and everyone can do it.

  1. zip the file to give download
  2. link the zip file to url. (e.g.<a href="../../../No_5.zip">No-5 downloadable</a>)
  3. View the result. After clicking "No-5 downloadable" link, open and save as dialog box will appear. I hope this way helps.

Upvotes: 1

Mattias
Mattias

Reputation: 9501

You control this with the headers, have a look at this answer for a wordpress style of doing it: How can I force a file download in the WordPress backend?

Otherwise you use your webserver to force-download pdf:s, but the above example might be what you were searching for.

Upvotes: 0

Related Questions