html5 – Download file by mobile device


I have a link, and when I click on that link, it downloads an image. So far so good, but when I access from a mobile device I can't download this file, does anyone have any idea or solution to solve this?


<a href="" download>
    Clique para baixar a imagem



You can try this, but it doesn't support all browsers:

<a href="/caminho/imagem" download="arquivo-para-baixar.jpg" title="Nome da imagem">
    <img src="/caminho/imagem/arquivo-para-ver.jpg" alt="Nome da imagem">

Example of use

See which one is supported here: .

But you can try using modernizr for that:

Another way is creating a .htaccess with the following rule:

<Files (arquivo1|arquivo2).jpg>
   ForceType application/octet-stream
   Header set Content-Disposition attachment

Model with Fiddle

Scroll to Top