mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
When a file is received, download.
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user