Media Library file names. Tired of guids?

Have you noticed that when uploading files to the media library, sometimes the resulting file name is a guid? If I upload an image, say Brian.jpg, I need to write ~/media/9B62BB56FD6040FAA56C6DB1D8A0BDE6.ashx in order to acces it from the front end.

And why is this a problem? Some search crawlers use the file name as title when the item is indexed. The Ankiro crawler can be configured to use the meta title (found in PDF or Word documents) or the file name as index title. Seeing a search result list with the file name 9B62BB56FD6040FAA56C6DB1D8A0BDE6 is not very explanatory for the end users.

Can this be configured? Well of course. This is Sitecore we are talking about.

The web.config contains loads of settings controlling the Media Library. Set the Media.UseItemPaths to true and your uploaded files will answer to the original file name so my Brian.jpg can be accessed at ~/media/Folder/Brian.ashx instead.

      This setting controls if item paths are used for constructing media URLs.
      If false, short ids will be used.
      Default value: true
<setting name="Media.UseItemPaths" value="true" />

About briancaos

Developer at Pentia A/S since 2003. Have developed Web Applications using Sitecore Since Sitecore 4.1.
This entry was posted in Sitecore 5 and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.