Legal Notice
The opinions expressed herein are my own personal opinions and do not represent my employer’s view in anyway.Top Posts
- C# HttpClient POST or PUT Json with content type application/json
- Using C# HttpClient from Sync and Async code
- Read blob file from Microsoft Azure Storage with .NET Core
- C# Get expiry timestamp from JWT token
- ASP.Net Core API - "'s' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0."
- C# Using Newtonsoft and dynamic ExpandoObject to convert one Json to another
- Creating dynamic arrays and lists using Dynamic and ExpandoObject in C#
Archive
Meta
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
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
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 media library, MediaItem, MediaManager, Sitecore
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