Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/small-tou/readonlinefile
读取远程图片或者文件并存储到本地
https://github.com/small-tou/readonlinefile
Last synced: 7 days ago
JSON representation
读取远程图片或者文件并存储到本地
- Host: GitHub
- URL: https://github.com/small-tou/readonlinefile
- Owner: small-tou
- Created: 2012-09-07T06:05:36.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2012-12-14T13:38:56.000Z (almost 12 years ago)
- Last Synced: 2024-04-15T02:48:56.342Z (7 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
readOnlinePic
=============读取远程图片或者文件并存储到本地
# summary
* 读取远程文件到指定路径并提供回调
* @param picUrl string 要读取的图片的路径
* @param targetPath string 目标存储路径,写完整,类型自行判断,无法根据content-type判断,可伪装
* @param callback function 回调方法,写入完成或者出错的时候回调 callback(info,error)
* 回调数据 出错时为空对象{},成功时为 {
targetPath:targetPath,
picUrl:picUrl
}
* @author yutou
* @email [email protected]
* @blog http://www.html-js.com***
#install
npm install readof***
#clone
$ git clone https://bitbucket.org/xinyu198736/readonlinefile.git/wiki***
#code
var readOF=require("readof");
readOF.read(pic,target_path,function(error,data){
//do something
});