When a file is received, download.

This commit is contained in:
Michael Jumper committed 2013-07-01 15:01:11 -07:00
1 parent 92adfbce90
commit be3e75d592
1 file changed
+19
@@ -769,6 +769,25 @@ GuacUI.Client.attach = function(guac) {
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.
*/