Angular 5 - Images do not load after being uploaded to the disk storage

222 views Asked by At

I have an Angular project for sharing photos. When I upload pictures everything works well - they are uploaded to the assets/images/uploads, which is said to be a public folder. Images are being uploaded with multer, using a simple Express server. I also use Kinvey to save some data for the images and I also save their filenames.

After I upload the images and I go to the page with all of the images, they are not being loaded. Note that the path to the image is correctly set at the image src tag.

When I rebuild the app, restart the server and refresh the page, all of the images load correctly. Any ideas?

1

There are 1 answers

2
Hoff On

The assets folder is part of the angular build process, and is not meant for dynamic content. You probably need to find another place where users can upload images to.