Next.js Discord

Discord Forum

Problem loading Images in Public Folder

Unanswered
Levriero Sardo posted this in #help-forum
Open in Discord
Levriero SardoOP
Here I create an API to upload images to the Public > UserData > Profile folder, when the image is successfully uploaded, then I open it in the browser, instead a 404 appears, but after I reload or restart the nextjs by turning it off and on again, the image can appear, maybe this is because nextjs does not support auto refresh in the public folder, here I run the nextjs project in Production and use Standalone mode, please provide a solution for this problem

7 Replies

I don't use the cloud because I upload the uploaded images to the nextjs public folder, so that they can be viewed directly by people who use it without me having to give access to the cloud.
is there any solution for this?
Only assets that are in the public directory at build time will be served by Next.js. Files added at request time won't be available. We recommend using a third-party service like Vercel Blob for persistent file storage.