#cannot save file in public folder dynamically
5 messages · Page 1 of 1 (latest)
That is expected, in NextJS all the files in the public folder are for static assets only, you cannot dynamically upload assets in there
If you want to dynamically upload and access files, use a cloud provider like AWS S3 (its free)
The reason why it works locally but not on Vercel is because when you are hosting your project locally/in developer mode, they let you dynamically upload and access assets in the public folder to speed up development, i.e. imagine you are hosting a static image banner for your website in the public folder but you want to test 3 other images, you can upload & see what they look like without having to rebuild your project every time
Where-as when you host your project on Vercel, it's in production mode, so all the static assets are bundled into one place where it is accessed from, if you want to update any of the static files in the public folder you'd have to rebuild the project every time you want to do that