Skip to content
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

UNABLE to SAVE File EVEN DOE using correct method? [2021] #1132

Closed
copyandexecute opened this issue Jan 4, 2021 · 2 comments
Closed

UNABLE to SAVE File EVEN DOE using correct method? [2021] #1132

copyandexecute opened this issue Jan 4, 2021 · 2 comments

Comments

@copyandexecute
Copy link

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.

await axios({
         url: '/downloads/client/latest.jar',
         method: "GET",
         responseType: "blob", // important
         onDownloadProgress: (progressEvent) => {
           setProgress(Math.round((progressEvent.loaded * 100) / progressEvent.total));
         }
       }).then(async value => {
         const mcDir = await promisified({cmd: "minecraftDir"});
         console.log(mcDir)
         console.log(value)
         console.log(value.data)
         await writeBinaryFile({contents: value.data, path: mcDir + "/norisk/test.jar"}, {});
       })

It creates an EMPTY + CORRUPTED File.
Whats the correct use?

Your sincerely,
Max

@zakpatterson
Copy link
Contributor

Duplicate of #1133 I think.

@nothingismagick
Copy link
Sponsor Member

agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants