Tag Archives: MediaItem

Sitecore – what is the hash property in the image query string?

Have you also wondered why Sitecore adds a “hash=” property to the image query string? https://yourwebsite.com/-/media/image.jpg?w=200&hash=A1FFA19B634EDF53A3AB3B757887E671F1C452A0 The hash key will protect your images from being scaled by others than your own server. The image above will only render if the … Continue reading


Posted in Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , , | Leave a comment

Stream Sitecore media items to HttpResponse

Here is a small tip for you who is doing API’s based on Sitecore. How to get an item from the Sitecore Media Library and stream it to the HttpResponse of a page. This is an example of an .ashx … Continue reading

Posted in .net, c#, Sitecore 7 | Tagged , , , | 1 Comment

Replacing mediaitems in Sitecore

This tip is from one of my colleagues Frederik Örnfelt who read my post about Adding a file to the Sitecore Media Library. But instead of adding files, he simply wanted to replace one item with another. Replacing media items … Continue reading

Posted in .net, c#, General .NET, Sitecore 6 | Tagged , , , | 1 Comment

Get Media Item file size

I recently worked at a project where I need to return the file size of the selected media item. It is actually very simple, as Sitecore has encapsulated the media item in a Sitecore.Data.Items.MediaItem class. This class contains the default … Continue reading

Posted in Sitecore 6 | Tagged , | 1 Comment