0
<div class='image_gallery_outer'>
<?php foreach($image_array as $arr){
$image = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."appimages/".trim($arr['newFileName']);
?>

<div class='image_gallery'>
    <img src="<?php echo  $image ?>"/>
    <span>
        <a href="<?php echo  $image ?>" download>
            <button class="download_img"><img style="display:none;" src="<?php echo  $image ?>"/>Download</button>
        </a>
    </span></div>   <?php }?>
</div>

Used above code, but its not working on safari & IE

0

Try to add the JS implementation, something like:

// IE10+ : (has Blob, but not a[download] or URL)
if (navigator.msSaveBlob) {
      return navigator.msSaveBlob(blob, fileName);
}

That should do the trick in IE according to this library https://github.com/rndme/download/blob/master/download.js#L143

Or you can follow this: https://stackoverflow.com/questions/10473932/browser-html-force-download-of-image-from-src-dataimage-jpegbase64

That might work for you.

| improve this answer | |
0

Create a controller that will send back the image with the proper HTTP headers.

Content-Disposition: attachment; filename=MyFileName.ext
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.