-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File downloading broken? #27
Comments
I am gonna link this to #30 I think we might be running into the same stuff here, not sure if file/audio streams are functional. |
I'm running into the same exact problem right now. Does anyone have a solution for this yet? Edit: typo |
So my update on this: We are using I analyzed this with So the root cause for this (and so for the empty @greyivy If you still have a running machine with guacamole, can you confirm this? (You have to set Edit: add/change words for better understanding |
A little late, but here is how it works: You need to send an acknowledge readyness to the stream to begin the data transfer. // Assuming that client == Guacamole.Client
client.onfile = (stream, mimetype, filename) => {
stream.sendAck("Ready", Guacamole.Status.Code.SUCCESS); // This is the crucial part
const reader = new Guacamole.BlobReader(stream, mimetype);
reader.onprogress = (length) => {
console.debug(`Downloaded ${length}`);
};
reader.onend = () => {
// Automatically create a link and download the file
const file = reader.getBlob();
const url = URL.createObjectURL(file);
const a = document.createElement("a");
a.href = url;
a.download = filename;
a.click();
a.remove();
};
}; |
I am unable to manipulate the InputStream from the onfile callback in the client. I do receive the mimetype and filename, but that's it. Has anyone had any luck downloading files (regardless of the method used)?
The text was updated successfully, but these errors were encountered: