How to get image from input type=file and send to server #3134
Unanswered
eatenpancreas
asked this question in
Q&A
Replies: 1 comment
-
Since you mention a server function, just checking: have you looked at the example of file uploads with server functions? IMO that is the best way to go, here. Otherwise, you can do what you describe (getting the file, converting it to base64, and sending it as a string) but in that case Leptos does not provide any of the relevant APIs, and you're in |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, i've been trying to use Leptos to extract an image and send it in base64 (or any other proper encoding that works tbh) to a server function.
I followed this:
#2537
However i can't find a way to properly encode this in base64. I tried FileReader but you need an onLoad function and i have no idea to map that to a Leptos function call.
I know it's part a web_sys issue but i eventually need the callback to reach the leptos code again to send it to the server function. I hope anyone can help!
Beta Was this translation helpful? Give feedback.
All reactions