Download file is opening the file directly in Chrome browser with IIS, Not downloading the file
I noticed that this is Chrome's feature and to turn it off I did the following steps:
- Go to setting by clicking on 3 dots on the right corner of the browser
- Click on the "Advanced" button at the bottom of the page.
- Go to the "Downloads" section
- Click on the "Clear" button beside "Open certain file types automatically after downloading"
How to force open links in Chrome not download them?
To make certain file types OPEN on your computer, instead of Chrome Downloading...
You have to download the file type once, then right after that download, look at the status bar at the bottom of the browser. Click the arrow next to that file and choose "always open files of this type". DONE.
Now the file type will always OPEN using your default program.
To reset this feature, go to Settings / Advance Settings and under the "Download.." section, there's a button to reset 'all' Auto Downloads
Hope this helps.. :-)
Visual Instructions found here:
http://www.presentermedia.com/blog/2013/10/my-file-automatically-opens-instead-of-saving-with-chrome/
Controller opens file in the browser instead of downloading it
Removing response.flushBuffer();
has fixed my issue.
Opening files in browser instead of downloading
add target="_blank" to get a new window. adding .pdf may help. If you have control over the host web server adjusting the headers for the files in question will also help it open inline. I can tell you what headers to set if you are able too
How to force a Download File prompt instead of displaying it in-browser with HTML?
This is something that you cannot absolutely control with HTML itself.
If the user is having a browser with PDF reading capabilities (or a plugin) and the corresponding settings to open PDF files in-browser, the PDF will open like that.
The PDF opens in a new tab simple because of your target="_blank"
, which has nothing to do with a download prompt.
If you are using HTML5 you can use the download attribute:
<a href="sample.pdf" download="sample.pdf">Download</a>
If you have a back-end service which you can control or you feel like fiddling with your Web Server, you can always look for setting the right Content-Disposition
. See this SO question for some nice discussion on Content-Disposition.
Related Topics
Regular Expression to Get a String Between Two Strings in JavaScript
How to Change Value of Object Which Is Inside an Array Using JavaScript or Jquery
Check If Json Response Data Is Empty
Change Button Color When Click on the Button
Scroll to Element from Typescript Code (Angular 5)
How to Read a Properties File in JavaScript from Project Directory
Reactjs and Images in Public Folder
Converting Byte Array to String in JavaScript
Javascript: Open Several Urls With One Button Click
Javascript or Jquery Browser Back Button Click Detector
Javascript: Replace Last Occurrence of Text in a String
Wait for Asynchronous Functions to Finish in Angular
Keep Selected Dropdown Result After Refreshing Page, Jquery
How to Bind on Click Event on Dynamically Created Button in Angular 6
Angular2 Do Actions After Dom Has Finished Rendering
How to Change Data Due to Selected Value in Select Vue
How to Get Public User All Posts from Instagram, Without Instagram API