How can I find the actual file referred to in a getmedia URL?

Don Rea asked on August 30, 2021 22:11

I have inherited a Kentico 11-managed site. I need to find the actual file referred to in an img with a src value of the form /getmedia/<GUID>/<Friendly name>. Neither the GUID nor the friendly name appears in a search of file and directory names within the CMS tree. How are those mapped to assets? Is there a DB table I need to look at?

Recent Answers


Brian McKeiver answered on August 30, 2021 23:29

You can query the database to get the reference you need.

SELECT '/your-site-top-level-media-folder/media/', L.LibraryFolder, F.FilePath, F.FileExtension--, L.*,F.* 
FROM [Media_File] F 
INNER JOIN [Media_Library] L 
    ON F.FileLibraryID = l.LibraryID
WHERE FileGUID = 'GUID'
0 votesVote for this answer Mark as a Correct answer

Don Rea answered on August 31, 2021 17:12 (last edited on August 31, 2021 17:12)

I can find the row in the Media_File table, but the file name it shows does not exist anywhere in the CMS directory tree. And I'm not even sure that's where I ought to be looking. How would I find out what this site's top level media folder is? Is that a setting I can look up, or is it maybe in the web.config?

0 votesVote for this answer Mark as a Correct answer

Brian McKeiver answered on August 31, 2021 18:58

It's in the settings of the Kentico instance under Content -> Media -> Media Libraries Folder. The most common configuration is the ~/<site name> folder.

Image Text

That folder is also ignored in some source control setups, since it has many large assets, so it may not be in a repo.

If you still can't find it the only other place would be to see if they have an external storage provider like I talk about here on my blog.

0 votesVote for this answer Mark as a Correct answer

Don Rea answered on November 4, 2021 20:57

It turned out the site media are stored in an AWS S3 bucket, which was not an easy thing to learn from the CMS settings and configuration.

0 votesVote for this answer Mark as a Correct answer

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