how to get formData in latest nextjs
Unanswered
Ashy Storm-Petrel posted this in #help-forum
Ashy Storm-PetrelOP
Hello there i've been going around nextjs app router files and i came accross getting formdata in the api i know i can use
but that only gets me the request body type json how can i get the formdata tho
const body = await req.json()but that only gets me the request body type json how can i get the formdata tho
7 Replies
Ashy Storm-PetrelOP
one more question can i upload images to monogDB or should i use something else?
@Ashy Storm-Petrel one more question can i upload images to monogDB or should i use something else?
you should use a dedicated file storage service such as aws s3 or cloudflare r2
@joulev you should use a dedicated file storage service such as aws s3 or cloudflare r2
Ashy Storm-PetrelOP
it's for cheap freelance job i was trying to get the best value for the money
and i saw some people upload to mongodb in youtube so i thought i may be able to do it
well you should use a dedicated file storage service, but you are not forced to. you can always convert the file to e.g. a base64 string then save the string in any databases; i'm just saying that you shouldn't do that