开发者

Download images for google chrome extension

i'm trying to build a batch image downloader in chrome. Basically, i will overlay a small download square to each image on th开发者_如何学运维e page and user clicks on it to download. Or the user can click to download all images on a page. I'm currently stuck on figuring out how to download the images. The best i can come up with is to use XHR to send the image to another server, the user can then retrieve it there.

If anyone have a solution for me. It would be much appreciated!

Jason


I believe you can XHR the images and using the File API you can store them locally.

Take a look at the following site http://www.html5rocks.com/features/file there are additional resources on the right column that has detailed examples and tutorials. Such as http://www.html5rocks.com/tutorials/file/filesystem/

Mohamed Mansour


This code will do the trick for you: https://gist.github.com/1049553 It's very simple usage of a 'feature' in chrome when you open an image in a new tab.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜