Save an image to the local folder from the website

2019-08-28 20:50发布

How can I save an image from the webpage by clicking on a link in smart phone, using JavaScript, jQuery or using HTML controls?

The sample code is as follows:

<a href="">Save image</a> 
<!--The Link to save the image-->
<img src"../images/logo.png" alt="Logo" height="50" width="50" /> 
<!--The Image that I wanted to save-->`

Now, I want to save the image logo.png in my local folder, by clicking on the link in smart phones (iPhone 4+, Android 2.1+ and BlackBerry 6+)?

2条回答
Ridiculous、
2楼-- · 2019-08-28 21:14

For example, iOS shows you the prompt to save the file when you press and hold onto the image. I don't think that you could do that just like in a desktop browser, like httprequest or response.binarywrite (c#).

查看更多
Melony?
3楼-- · 2019-08-28 21:18

Usually browsers have their own handling when you click a link which points directly to a downloadable file: either asks you where you want to save it, or it downloads the file to a predefined location. I'm not sure if you can override this.

查看更多
登录 后发表回答