Search code examples
mongodbherokustrapi

Strapi photos disappeared


I am using Heroku for deploy, mongoDB Atlas as Database and Strapi as Headless CMS. Heroku is already working with hobby Dyno. Yesterday I added some data into my database with some pictures and it was working fine but after 24 hours my Strapi doesn't display the pictures, I checked my DB and seems like I still have documents with photos. So if you encountered this problem before where is the problem and how did you sol it?


Solution

  • Heroku will delete all files stored on the server after each restart.

    Check on documentation:

    https://strapi.io/documentation/developer-docs/latest/getting-started/troubleshooting.html#why-is-my-app-s-database-and-uploads-resetting-on-paas

    For file uploads, you will need to use one of the 3rd party providers such as Cloudinary or AWS S3.

    For AWS S3 you can check the docs using a provider:

    https://strapi.io/documentation/developer-docs/latest/development/plugins/upload.html#using-a-provider

    For more providers you can search on npm:

    https://www.npmjs.com/search?q=strapi-provider-upload-&ranking=popularity