diff --git a/src/backend/guacamole/routes.ts b/src/backend/guacamole/routes.ts index b77bd981..ced650e2 100644 --- a/src/backend/guacamole/routes.ts +++ b/src/backend/guacamole/routes.ts @@ -206,6 +206,10 @@ router.post( switch (connectionType) { case "rdp": + if (guacConfig["enable-drive"] && !guacConfig["drive-path"]) { + guacConfig["drive-path"] = "/drive"; + guacConfig["create-drive-path"] = true; + } token = tokenService.createRdpToken(hostname, username, password, { port: port || 3389, domain, diff --git a/src/ui/features/guacamole/GuacamoleDisplay.tsx b/src/ui/features/guacamole/GuacamoleDisplay.tsx index e8242441..66af7f52 100644 --- a/src/ui/features/guacamole/GuacamoleDisplay.tsx +++ b/src/ui/features/guacamole/GuacamoleDisplay.tsx @@ -395,6 +395,20 @@ export const GuacamoleDisplay = forwardRef< Guacamole.AudioPlayer.getInstance(stream, mimetype); }; + client.onfile = (stream: Guacamole.InputStream, mimetype: string, filename: string) => { + const reader = new Guacamole.BlobReader(stream, mimetype); + reader.onend = () => { + const blob = reader.getBlob(); + const url = URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; + a.download = filename; + a.click(); + URL.revokeObjectURL(url); + }; + stream.sendAck("OK", Guacamole.Status.Code.SUCCESS); + }; + client.connect(); }, [ getWebSocketUrl,