Is there any way to force the user's download-manager to start a download for .PDF instead of showing the .PDF in a new window/tab?
相关问题
- Correctly parse PDF paragraphs with Python
- Set BaseUrl of an existing Pdf Document
- How to download and run a .exe file c#
- How can I get all text from a PDF in Swift?
- Renaming named destinations in PDF files
相关文章
- Python Sendgrid send email with PDF attachment fil
- C# MVC website PDF file in stored in byte array, d
- How To Programmatically Enable/Disable 'Displa
- How to reduce PDF file size programmatically in Ja
- Search and replace placeholder text in PDF with Py
- ITextSharp 4.1.6. PDF Table - how to remove whites
- jsPDF justify text
- how to programmatically download a public Google D
Set Content-Disposition in your HttpResponse header:
For IIS:
Put all files you want to force to download in their own folder.
Then in IIS go that folder and double click HTTP Response Headers.
Add a new header with the following info:
Name: content-disposition
Value: attachment
All files in that folder, when accessed, should prompt the save as dialog box for the appropriate browser.
From vb asp net code found on the internet i made this simple c# download.aspx page. You can use with the file url passed as "f" querystring parameter. (/folder/download.aspx?f=/folder1/example.pdf).
This needs to be done in the server side. You can't do this at the client side.
How to do it depends on the server side language in question.
PHP:
Java:
.NET:
If there's no means of any server side code which streams the PDF file, then you need to configure it at webserver level. In for example Apache HTTPD, you can place/expand a
.htaccess
file in the PDF folder's root with the following entry:or configure it globally in
httpd.conf
file. Similar approach exist for IIS withweb.config
file.