fix: implement guacamole drive redirection file transfer

This commit is contained in:
ZacharyZcR
2026-05-13 17:17:16 +08:00
parent ec87f8a4d1
commit 453b6ea138
2 changed files with 18 additions and 0 deletions
+4
View File
@@ -201,6 +201,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,
@@ -388,6 +388,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,