diff --git a/guacamole/src/main/webapp/scripts/client-ui.js b/guacamole/src/main/webapp/scripts/client-ui.js index f1b8fd2c9..c94ad9143 100644 --- a/guacamole/src/main/webapp/scripts/client-ui.js +++ b/guacamole/src/main/webapp/scripts/client-ui.js @@ -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. */