When a file is received, download.

This commit is contained in:
Michael Jumper
2013-06-24 15:35:12 -07:00
parent 92adfbce90
commit be3e75d592

View File

@@ -769,6 +769,25 @@ GuacUI.Client.attach = function(guac) {
GuacUI.sessionState.setProperty("clipboard", data); GuacUI.sessionState.setProperty("clipboard", data);
}; };
/*
* Prompt to download file when file received.
*/
guac.onblob = function(blob) {
// When complete, prompt for download
blob.oncomplete = function() {
var url = window.URL || window.webkitURL;
var a = document.createElement("a");
a.href = url.createObjectURL(blob.getBlob());
a.download = blob.name;
a.click();
};
};
/* /*
* Do nothing when the display element is clicked on. * Do nothing when the display element is clicked on.
*/ */