Add sh.wget() for downloading files into the fs, with tests and docs
This commit is contained in:
parent
1b12f44a02
commit
0e213077e7
|
@ -1343,6 +1343,7 @@ sh.mkdirp('/test/mkdirp', function(err) {
|
||||||
#### sh.wget(url, [options], callback)<a name="wget"></a>
|
#### sh.wget(url, [options], callback)<a name="wget"></a>
|
||||||
|
|
||||||
Downloads the file at `url` and saves it to the filesystem.
|
Downloads the file at `url` and saves it to the filesystem.
|
||||||
|
|
||||||
The file is saved to a file named with the filename portion of the url
|
The file is saved to a file named with the filename portion of the url
|
||||||
unless the `options.filename` is present, in which case that
|
unless the `options.filename` is present, in which case that
|
||||||
filename is used instead. The callback receives `(error, path)`,
|
filename is used instead. The callback receives `(error, path)`,
|
||||||
|
|
|
@ -471,6 +471,7 @@ define(function(require) {
|
||||||
if("withCredentials" in request) {
|
if("withCredentials" in request) {
|
||||||
request.withCredentials = true;
|
request.withCredentials = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
request.responseType = "arraybuffer";
|
request.responseType = "arraybuffer";
|
||||||
request.send();
|
request.send();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue