Uploaded Images Fail to Show in Server

System Information
  • Strapi Version: 4.4.5
  • Operating System: Windows 10 Pro
  • Database: PostgreSQL
  • Node Version: 16.16.0

Hi,

I created an image folder under the Media Library in Strapi to manage my uploaded images. The image will display fine in my local environment, but the minute we deploy the content to the development server, the images fail to show. Through Postman, I can see the default path to the images as “/uploads/xxxxx.png.” However, in VS Code, all the images are in the “public/uploads” folder with random numbers appended to the file names.

Note: In my screen prints, I only show a few pictures for brevity. Below is the response from Postman with the URL path.

“image”: {

                "id": 19,

                "name": "woman_yellow_shirt_laptop_smiling.jpg",

                "alternativeText": "woman_yellow_shirt_laptop_smiling.jpg",

                "caption": "woman_yellow_shirt_laptop_smiling.jpg",

                "width": 229,

                "height": 156,

                "formats": null,

                "hash": "woman_yellow_shirt_laptop_smiling_d64e747081",

                "ext": ".jpg",

                "mime": "image/jpeg",

                "size": 6.57,

                "url": "/uploads/woman_yellow_shirt_laptop_smiling_d64e747081.jpg",

                "previewUrl": null,

                "provider": "local",

                "provider_metadata": null

            }

I attached two screen-prints to show you where the uploaded images reside in Strapi and how VS Code saved them.

Am I missing something?


I realize this is an old post but for anyone else facing this, it may be because the default .gitignore file has public/uploads/* so any files there won’t be deployed. You can remove this line if you want but then you’d have to commit and redeploy every time you add new images. Alternatively, use one of the upload providers maintained by Strapi. Here’s an official guide for Cloudinary

Note: Any media you add will now be uploaded to your specified provider and should show up in the hosted version as well. For old media that aren’t showing, you’ll have to manually remove, re-upload and then link them to content entries.