404 for Images Using GetAttachment

Andre Pfanz asked on April 17, 2018 22:47

We are using Kentico v11.0.15 and are seeing a problem with some images giving a 404 on my local computer. Here is an example of one URL:

https://localhost/getattachment/about/vp_megamenu_feat_packaginganalysis.jpg?width=450&height=510&ext=.jpg

I checked the Settings->System->Files->Storage and found the files are stored in both the database and file system.

Does anyone have any ideas on what I can do next? How do I go about finding the physical file?

Correct Answer

Andre Pfanz answered on April 18, 2018 00:06

I figured out the answer. I had to add this to web.config:

<modules runAllManagedModulesForAllRequests="true">

Peter, I don't know where the URL came from as I'm new to the site.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Peter Mogilnitski answered on April 18, 2018 00:02 (last edited on April 18, 2018 00:25)

your are missing .aspx in the URL:

https://localhost/getattachment/about/vp_megamenu_feat_packaginganalysis.jpg.aspx?width=450&height=510&ext=.jpg

How exactly do you get this URL? Normally if you get them in transformation you use these methods Your files might be stored as binary in the DB, because of your settings.

select * from CMS_Attachment where attachmentname = 'vp_megamenu_feat_packaginganalysis.jpg'

If it settings were set to file system, then whiout workflows your files should ~/<site code name>/files . Here is the documentation

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on April 18, 2018 04:00

Oh this means you have Extensionless URLs configured

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.