Next.js Discord

Discord Forum

Sending images from frontend to backend

Unanswered
Siamese posted this in #help-forum
Open in Discord
SiameseOP
Hello, what's the correct way to send a POST request from frontend to backend with an object with some settings and a picture in base64? I saw that the limit for data size that will be processed can be increased, but not sure if that's the best way.

10 Replies

SiameseOP
(I'm selfhosting in nodejs enviroment)
@@ts-ignore FormData
SiameseOP
Huh?
Spectacled bear
Send it using post within form body and use the form submit action is what that means. Am I correct @@ts-ignore
Dark-eyed Junco
Let me know you, please DM.
you can add more fields in formdata too and access it on backend for updating other things
@Spectacled bear Send it using post within form body and use the form submit action is what that means. Am I correct <@510480545160101898>
SiameseOP
But I get error 413 payload too large. I don't think that would change anything?
Or do you mean to set the image in form action instead of sending it with API
That won't work for me