#How do I upload file in stable version of Tauri?

5 messages · Page 1 of 1 (latest)

silk pecan
#

Hello, I'm currently trying to upload file in bytes to my remote server. I have a single endpoint, and just simply need to upload the file, and get back the result.

Currenlty I've tried doing it both via tauri-api with fetch function, and the result is nothing. I've succeeded a few times, but for some reason it only allow like 1 second uploads, cuz anything more than that is "too large". And I've tried it on the rust-end. Now, I'm a complete beginner in Rust, so I would gladly assume that I did something wrong. But it's very strange that on the server the requests are showing, but the uploaded raw data of the file is always 0 bytes.

Can anybody help please? I need to upload file as a raw data to my server.

#

Here is my tauri-api code

#

And here's the rust code

spice sage
silk pecan
# spice sage we'd have a plugin for that if you prefer js: <https://github.com/tauri-apps/plu...

Thanks! I managed to do it in Rust my own way. However, now there's some problem with formatting. On my server, it formats things just fine, but when I get the value in front end, it's messed up. Can you please look into that? I would be emmersely grateful as this is already taking up a long time.

Image(1): Correct formatting, line breaks
Image(2,3): Handling the text
Image(4): Incorrect formatting. Also for some reason it added quotes

Idk what's going on because now when I try to convert to markdown it straight up doesnt work. It's as if it doesnt understand that \n is supposed to be a line break, and not a literal symbol.

Am I doing something wrong with response handling?