Migrate blob to input stream (ish) API.
This commit is contained in:
1 parent
8848b87c21
commit
68e2e2b028
2 files changed
+68
-64
No files matched your search
@@ -790,23 +790,23 @@ GuacUI.Client.attach = function(guac) {
|
||||
|
||||
}
|
||||
|
||||
guac.onblob = function(blob) {
|
||||
guac.onfile = function(filename, stream) {
|
||||
|
||||
var download = new GuacUI.Download(blob.name);
|
||||
var download = new GuacUI.Download(filename);
|
||||
download.updateProgress(getSizeString(0));
|
||||
|
||||
GuacUI.Client.notification_area.appendChild(download.getElement());
|
||||
|
||||
// Update progress as data is received
|
||||
blob.ondata = function() {
|
||||
download.updateProgress(getSizeString(blob.getLength()));
|
||||
stream.onreceive = function() {
|
||||
download.updateProgress(getSizeString(stream.getLength()));
|
||||
};
|
||||
|
||||
// When complete, prompt for download
|
||||
blob.oncomplete = function() {
|
||||
stream.onclose = function() {
|
||||
|
||||
download.ondownload = function() {
|
||||
saveAs(blob.getBlob(), blob.name);
|
||||
saveAs(stream.getBlob(), filename);
|
||||
};
|
||||
|
||||
download.complete();
|
||||
|
||||
Reference in new issue
Block a user