-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
writeBinaryFile **DOES NOT WORK** even though correct USAGE! [2021 ISSUE] #1133
Comments
The issue is basically that writeBinaryFile in the JS api does not call WriteBinaryFile in the rust API, but instead calls WriteFile in the Rust API with the file contents base64 encoded. So you may find, that your jar file that is saved in your filesystem is fine, it just needs to be base64 decoded, as I am working on a fix now. |
Fixes tauri-apps#1133 writeBinaryFile was reusing writeFile, which was happily saving base64 encoded strings to the fs. This instead uses the correct WriteBinaryFile command, which base64 decodes. However why are we encoding and then decoding, why can we not just send a raw byte array to be saved as a file? This is left for a later PR.
Fixes tauri-apps#1133 writeBinaryFile was reusing writeFile, which was happily saving base64 encoded strings to the fs. This instead uses the correct WriteBinaryFile command, which base64 decodes. However why are we encoding and then decoding, why can we not just send a raw byte array to be saved as a file? This is left for a later PR.
* Fix writeBinaryFile to call the correct command Fixes #1133 writeBinaryFile was reusing writeFile, which was happily saving base64 encoded strings to the fs. This instead uses the correct WriteBinaryFile command, which base64 decodes. However why are we encoding and then decoding, why can we not just send a raw byte array to be saved as a file? This is left for a later PR. * Shorten changelog line per review
@copyandexecute You might try pulling down the |
Dear Tauri Team,
I am trying to download a jar file and then save it with your provided funcation "writeBinaryFile". Unfortunately it does not work.
It creates an EMPTY + CORRUPTED File.
Whats the correct use?
Your sincerely,
Max
The text was updated successfully, but these errors were encountered: