<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 ?>"/>
        <a href="<?php echo  $image ?>" download>
            <button class="download_img"><img style="display:none;" src="<?php echo  $image ?>"/>Download</button>
    </span></div>   <?php }?>

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


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 | |

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.