forked from tauri-apps/tauri
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix writeBinaryFile to call the correct command
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.
- Loading branch information
1 parent
5810bae
commit 892d18b
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
"tauri.js": patch | ||
"tauri": minor | ||
--- | ||
|
||
fix writeBinaryFile in the js api to call the correct function | ||
on the rust side. Before, files were sent in base64 encoding, but | ||
the save-as-text `WriteFile` fs command was reused, without any | ||
indication that the contents were base64 encoded. So the WriteFile | ||
command had no way of checking and decoding when necessary. | ||
WriteBinaryFile on the rust side expects a base64 encoded string, then | ||
decodes it. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters