0
<!DOCTYPE html>
<!--
 This page is shown when the extension button is clicked, because the
 "browser_action" field in manifest.json contains the "default_popup" key with
 value "popup.html".
 -->
<html>
  <head>
    <title>Test title</title>
    <style>
      body {
        font-family: "Segoe UI", "Lucida Grande", Tahoma, sans-serif;
        font-size: 100%;
      }
      #status {
        /* avoid an excessively wide status text */
        white-space: pre;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: 400px;
      }
    </style>
  </head>
<body>
  <p>Example 1<br>
     <a href="http://dummyimage.com/600x400/000/fff.png" download>Download this image</a></p>
</body>
</html>

The above, is a button (kind of) that downloads an image. It works fine on my laptop, but when I navigate to the url on my iPhone it doesn't download. Just takes me to the actual image.

Anyone know why? Or how I can fix this?

Thanks!

pourmesomecode
  • 3,518
  • 5
  • 36
  • 76
  • Seems `download` attribute is only supported on Chrome, Firefox and Opera. http://www.w3schools.com/tags/att_a_download.asp – Rory McKinnel Sep 03 '15 at 09:45
  • Is there anyway to get it to work on the iPhone though? – pourmesomecode Sep 03 '15 at 09:50
  • If you do not mind using a button or Javascript, there are some solutions here: http://stackoverflow.com/questions/11620698/how-to-trigger-a-file-download-when-clicking-an-html-button-or-javascript – Rory McKinnel Sep 03 '15 at 09:50
  • Thanks @RoryMcKinnel I had a look at this link. But iPhone doesn't allow you to select the button and download an image from it. Just wondered if there's a work around for it :) Thanks though! – pourmesomecode Sep 03 '15 at 09:55
  • 1
    Seems to be many many articles on this, all of which seem to end up wishing Safari supported the download attribute 8^((. – Rory McKinnel Sep 03 '15 at 10:26
  • Yeah, i've been endlessly reading through articles but haven't found anything. I appreciate your time and help though! :) – pourmesomecode Sep 03 '15 at 10:37

1 Answers1

0

iPhone doesn't have a download functionality. You will need to tap-and-hold, and select "Save".

keldar
  • 5,548
  • 8
  • 46
  • 68
  • I thought so, is there no way arounds this? For the less tech savvy people, i'd like to be able to have a download button to prompt the user to download the image rather then holding down on the image and saving it. – pourmesomecode Sep 03 '15 at 09:45
  • I don't think there is I'm afraid. iOS is quite limiting in that regard. – keldar Sep 03 '15 at 10:04