isha
isha

Reputation: 11

Mozilla Firefox download option

Firefox open PDF file in a new tab. Any option to download directly? I use download in a tag. When we click on download button it will open in a new tab.

DOWNLOAD

Upvotes: 1

Views: 480

Answers (2)

James
James

Reputation: 1123

HTML5 comes equipped with a download attribute, and compatibility is actually pretty good.

<a href="path/to/file.pdf" download="filename.pdf">Download</a>

https://www.w3schools.com/tags/att_a_download.asp

Upvotes: 2

Sveta
Sveta

Reputation: 1231

You need to add a header in your server that will force the file to download:

location ~* (.+\.pdf)$ {
    add_header Content-disposition "attachment; filename=$1";
}

Upvotes: 2

Related Questions