html - File opens instead of downloading in internet explorer in a href link -
<a href="path/to/file/filename.xxx" download="filename.xxx">filename</a>'
when click link, filename.xxx should downloaded.
it works in chrome. in internet explorer, opens file instead of downloading. problem? there properties added make work in ie.
and need file download sample works browsers.
the download attribute not supported in ie (see http://caniuse.com/#search=download%20attribute).
that suggests download attribute supported firefox, chrome, opera , latest version of blackberry's browser.
for other browsers you'll need use more traditional methods force download. server side code necessary set appropriate content-type , content-disposition header tell (or trick depending on point of view) browser download item. headers should this:
content-type: application/octet-stream content-disposition: attachment;filename=\"filename.xxx\"
(thanks antyrat copy , paste of headers)
Comments
Post a Comment