Add filename

This commit is contained in:
Kabir Sala 2014-02-12 05:15:17 +01:00
parent 15d8da033a
commit a439ecf4f2
4 changed files with 5 additions and 1 deletions

View File

@ -5695,6 +5695,7 @@
if (_ref = urlBlob.type, __indexOf.call(QR.mimeTypes, _ref) < 0) {
QR.error("Unsupported file type.");
}
urlBlob.name = url.substr(url.lastIndexOf('/') + 1, url.length);
QR.handleFiles([urlBlob]);
return;
return {

Binary file not shown.

View File

@ -5696,6 +5696,7 @@
if (_ref = urlBlob.type, __indexOf.call(QR.mimeTypes, _ref) < 0) {
QR.error("Unsupported file type.");
}
urlBlob.name = url.substr(url.lastIndexOf('/') + 1, url.length);
QR.handleFiles([urlBlob]);
} else {
QR.error("Can't load image.");

View File

@ -276,11 +276,12 @@ QR =
xhr.open('GET', url, true)
xhr.responseType = 'blob'
xhr.onload = (e) ->
if this.readyState == this.DONE && xhr.status == 200
if @readyState is @DONE && xhr.status is 200
urlBlob = new Blob([this.response], {type : this.getResponseHeader('content-type')})
return if urlBlob.type == null
unless urlBlob.type in QR.mimeTypes
QR.error "Unsupported file type."
urlBlob.name = url.substr(url.lastIndexOf('/')+1, url.length)
QR.handleFiles([urlBlob])
return
else
@ -318,6 +319,7 @@ QR =
unless urlBlob.type in QR.mimeTypes
QR.error "Unsupported file type."
urlBlob.name = url.substr(url.lastIndexOf('/')+1, url.length)
QR.handleFiles([urlBlob])
return