Next.js Discord

Discord Forum

Real time dynamic images folder problem

Answered
Idra posted this in #help-forum
Open in Discord
Hi everyone! I'm working on an image-based platform. Everything works fine until I switch to production.

In production, when a user creates an image, the image gets uploaded through my custom Next.js 13 API route and is stored in a folder located in "public/uploads".

It works! However, the image doesn't appear to the user on the website until I rebuild the entire website. I'm using Next-Image to display the image, but regardless of the configuration I have, the image doesn't show up, so i can't show real-time images.

I was thinking: could I upload these images to a different folder so that I don't need to rebuild the entire website?

Can someone help me?
Thanks!
Answered by joulev
you cannot save it in public, the content of public is taken during build and further writes into the folder are ignored
View full answer

6 Replies