Merge pull request #775 from ZacharyZcR/fix/guacamole-drive-redirection

fix: implement guacamole drive redirection file transfer
This commit is contained in:
ZacharyZcR
2026-05-18 04:35:16 +08:00
committed by GitHub
2 changed files with 18 additions and 0 deletions
+4
View File
@@ -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,
@@ -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,