From 0e213077e70f4c39f8989de39c7781fb8283a768 Mon Sep 17 00:00:00 2001 From: "David Humphrey (:humph) david.humphrey@senecacollege.ca" Date: Tue, 25 Mar 2014 11:47:08 -0400 Subject: [PATCH] Add sh.wget() for downloading files into the fs, with tests and docs --- README.md | 1 + src/shell/shell.js | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index d8e0132..0aaa0b9 100644 --- a/README.md +++ b/README.md @@ -1343,6 +1343,7 @@ sh.mkdirp('/test/mkdirp', function(err) { #### sh.wget(url, [options], callback) 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 unless the `options.filename` is present, in which case that filename is used instead. The callback receives `(error, path)`, diff --git a/src/shell/shell.js b/src/shell/shell.js index 4d33c01..1d91bed 100644 --- a/src/shell/shell.js +++ b/src/shell/shell.js @@ -471,6 +471,7 @@ define(function(require) { if("withCredentials" in request) { request.withCredentials = true; } + request.responseType = "arraybuffer"; request.send(); };