diff options
Diffstat (limited to 'lib/storage.js')
-rw-r--r-- | lib/storage.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/storage.js b/lib/storage.js index 3721fe4..48d88a1 100644 --- a/lib/storage.js +++ b/lib/storage.js @@ -275,9 +275,12 @@ File.prototype.createReadStream = function (opts) { */ File.prototype.getBlobURL = function (cb) { var self = this + if (global.URL === undefined || global.Blob === undefined) { + return cb(new Error('file.getBlobURL requires window.URL window.Blob support')) + } self.getBuffer(function (err, buf) { if (err) return cb(err) - var url = URL.createObjectURL(new Blob([ buf ])) + var url = global.URL.createObjectURL(new global.Blob([ buf ])) cb(null, url) }) } |