Take the community feedback survey now.

Image / Media is not accessible, Its giving 404

Vote:
 

Hi,

When I try to download(click on triple dot and download) or access the image url directly in the browser its giving 404 response.

Not sure what is wrong in the code.

 

Also we are getting on broken file on right click and download.

Anyone experienced this kind of issue?

Thanks,

 

#340172
Edited, Sep 01, 2025 12:34
Vote:
 

Hi, Flinn

If you make your way to the App_Data/blobs (default location of media storage on disk in Optimizely CMS) from your solution - do you actually see the physical image?

It could be a missmatch with your localhost environment lacking the actual blob provider path or physcially the images.

 

#340209
Sep 02, 2025 12:03
Vote:
 

Hi Eric,

Yes, 

  1. We could see the physical image in the App_Data/blobs folder along with thumbnail.
  2. We are able to upload new image/pdf without any issues.
  3. And with alloy project its working fine.
  4. Even I tried to provide IUSR read/write permission for App_Data/blobs folder.
  5. I tried adding custom blob provider in appsetting.json and startup file, I know this is not needed since its an basic CMS functionality.

Still no luck. 

Thanks for looking. 

 

#340211
Sep 02, 2025 15:27
Vote:
 

Since you're image is referring to a png extension, could you confirm you have enabled mediadescriptors for your valid extension:

[MediaDescriptor(ExtensionString = "jpg,png,gif")].

 

Should be addressed for MediaData.cs or ImageFile.cs or whatever your solution refers to 

#340213
Sep 02, 2025 17:13
Vote:
 

Hi  Flinn,

There are few points you need to check.

1) For uploading the image/media, you should have one class for image/media and that class should inherite from MediaData or ImageData

public class DocumentFile : MediaData
{

}

2) For uploading specific image like .png, Media types must be decorated with an extra attribute called MediaDescriptor


[MediaDescriptor (ExtensionString = "png")]
publicclass DocumentFile : MediaData

Point to remember- Be careful with the extensions that the media types support. If a media item is uploaded when the class has
one set of extensions and the extension is later removed, the previously uploaded media will be “broken” in
the UI.

3) Ensure the media file (image) is published — not just saved as a draft.

4) Make sure you are rendering image using-

@Url.ContentUrl(Model.Image)

5) Url of image is autogenerate, if you are uploading image and doing view in browser. So make sure image would be proper. Or try with other image and check still having the same issue.

Thanks,

 

#340220
Sep 03, 2025 11:15
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.