How can I create an Image Download Link in HTML for a Mobile Page?

后端 未结 4 1518
南笙
南笙 2021-02-19 04:22

I have a mobile html page which contains images. I want to create a button or a link which is used for a download of an image. The image should then be saved to the users mobile

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-19 05:14

    Somebody seems to have answered this already,

    
        ImageName
     It's not yet fully supported http://caniuse.com/#feat=download, but you can use with modernizr
    

    http://modernizr.com/download/#-a_download (under Non-core detects) to support all browsers.

    Have not tested, but should work in mobiles as well.

    I would add that, as a server side solution, you could also add Response Headers to your download endpoint by

    • Setting it up in apache (.htaccess) / nginx configuration
    • Right from the code

提交回复
热议问题