upload file and save it to public directory #11634
Replies: 8 comments 17 replies
-
|
I have the same issues |
Beta Was this translation helpful? Give feedback.
-
|
Just tested, I still can upload avatar image to Vercel. With small size still well. Limit it is ~5-6MB |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @muhaimincs i had some troubles with your implementation for multiple files and it worked for me this way: Client side API side |
Beta Was this translation helpful? Give feedback.
-
|
Unfortunately, it is not working when deployment on vercel platform. |
Beta Was this translation helpful? Give feedback.
-
|
Hi there, Client Side: Server Side: I relied on the following solution: |
Beta Was this translation helpful? Give feedback.
-
|
there is a bug! when define imageFile value you have to do like this And it will work. |
Beta Was this translation helpful? Give feedback.
-
|
Is it legal?? I uploaded files in |
Beta Was this translation helpful? Give feedback.
-
|
Disabling the default body parser is definitely part of making multipart work correctly here. I’d just add one more layer after parsing: once the file is successfully received, inspect it server-side before writing it to a public or persistent location. I built Pompelmi for this exact step: It’s an OSS Node.js package focused on untrusted upload inspection before storage (type sniffing, mismatch detection, risky archive signals, etc.). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been looking example for uploading multiple files to the nextjs api. So I come up with my own solution here.
here the request from client
this is the
api/upload.jscontentI just do simple image upload, it is working but the file is in incomplete shape/form. What do you guys think that I missed?
Beta Was this translation helpful? Give feedback.
All reactions