Open pdf link keeps downloading






















Add a comment. Active Oldest Votes. Quentin k gold badges silver badges bronze badges. ColinM ColinM Taboada but then the user's system may not know the file type. Perhaps if you want to override the user's preferences then octet-stream would be the way to go, but giving the correct type and a suggested filename is the "correct" way to provide a download.

So my question is should the content type be set before uploading? And also, we get only a link from the backend team, a url that gives the file path, that we open in new tab using:window. Kailas I don't understand what you're trying to do.. These headers have no effect on a file upload, you need to have the code behind the url set the headers every time it is downloaded by the client. ColinM Thanks buddy, you said it right, the issue when we debugged was the mime type was set while uploading the files.

This should be done by the back-end team. I tried to get codes on how to add headers in java script but was not successful. Thanks, as I got the real idea cleared from you Show 5 more comments. It uses the custom filename specified on the view side. Christophe Roussy Christophe Roussy Akshay Akshay 2, 3 3 gold badges 32 32 silver badges 70 70 bronze badges.

If you have control over the server code you should use 'attachement' as this will allow to use the same filename generation code. If you have no control over the server this is a good solution. This is a brilliant solution to the problem however, as always, IE is holding us back from using it: caniuse. Important to note that this does not work across domains e. If downloading from one domain, the download attribute will not work if content is stored on a different domain.

CORS may allow that content to pass through haven't tested. Yes figured! Show 1 more comment. This is for ASP. FilePath, FileMode. Open, FileAccess. The above tweak uses the AlwaysOpenPdfExternally policy which is supported in the browser starting in Edge When the PDF file download option is configured via the group policy option, users won't be able to change in Edge settings. The enforcement will be applied to all user accounts on your computer.

It is not set by default, so users can manage the Always open PDF files externally setting in the browser as described in the first method in this post. Download Registry Files. Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:. If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow.

Thanks for your support! Sergey Tkachenko is a software developer from Russia who started Winaero back in On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Browse All Community Hubs. Turn on suggestions. Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for. Show only Search instead for. Did you mean:. Sign In. Hello Edge experts. Any tips or ideas? Thanks, Ruslan View best response. TheShaunSaw Hello and thank you! How can you tell that the link is a download link and not directly a. Hello RNalivaika your link is correct, there is no difference between a download link and a PDF link, it's just how the browser handles the extensions. Here is the solution: let the PDF file download in Edge at least once, then right-click here and choose: "Always open with system viewer".

HotCakeX I thought like that because when I open PDFs from my school website and some other websites, it does not download it and views it online without the option checked as shown in your reply and when I only went to that link, it started downloading the PDF. Thank you for helping.

Podcast what if you could invest in your favorite developer? Featured on Meta. Now live: A fully responsive profile. Reducing the weight of our footer. Related Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled.



0コメント

  • 1000 / 1000