Is there any way to download attribute work in IE. When try to force download file under IE using
Following is work fine in Firefox but not under IE
<a href="image.jpg" download>Click to download</a>
The download attribute only works for same-originl URLs. So if the href is not the same origin as the site, it won't work. In other words, you can only download files that belongs to that website. This attribute follows the same rules outline in the same-origin policy.
The download attribute specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink. The optional value of the download attribute will be the new name of the file after it is downloaded.
Approach 1: Using Download attribute The download attribute simply uses an anchor tag to prepare the location of the file that needs to be downloaded. The name of the file can be set using the attribute value name, if not provided then the original filename will be used.
<a> is the link tag. href attribute sets the file to download.
As of now IE doesn't support download attribute, even the latest version. Some jquery plugins are available to make HTML5 tags work in IE older versions. You can give a try. Even safari also doesn't support.
You can check the full details on browsers compatibility for download attribute here
http://devble.com/set-filename-downloaded-file/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With