I have this behavior on the internet explorer where if I click on download button the image will be opened in a new tab instead of prompting the download window.
Does anyone have an idea on how to change this behavior?
On others browser this seems to work just fine.
I'm using the Asset Class to get the asset download link;
path = asset.getPath();
Solved! Go to Solution.
This is not code issue , this is IE behaviour though you can force image to download by adding content header as download.
Extra header can be added for images on server side as part of HTTP redirect rules.
Please check for RewriteRule Flags - Apache HTTP Server Version 2.4 Redirect rules
T type is used to set mime type
Sets the MIME type with which the resulting response will be sent. This has the same effect as the
You can combine the use of
Content-Disposition with other content-types, such as
image/png or even
text/html to indicate you want saving rather than display. It used to be the case that some browsers would ignore it in the case of
Moreover you can set above only for IE browser