Working on a page that contains links to files such as doc, excel, PDF.
On IE 8 if a user clicks the link(an example would be www.examplesite.com/files/somefile.doc
), the page starts to load the URL from the link and a save dialogue opens up. This behavior doesn't exist in IE 9 and Firefox. The browsers Simply open a save dialogue box without navigating away from the initial page.
I don't want the browser to load the download link and navigate away from the initial page. the user accessed. One solution I found is to add a target='blank'
attribute on the link. But this would open a new window which is fine but not the best solution I wanted to have.
Is there any way to mimic the same behavior in IE 8 to enable the user to open the dialogue without navigating away from the current page.
Http header response captured in firefox looks like this.
HTTP/1.1 200 OK
Content-Type: application/msword
Last-Modified: Thu, 21 Feb 2013 17:29:08 GMT
Accept-Ranges: bytes
Content-Length: 556544