23 votes
Accepted

Access denied security roles on media attach

Since it has been more than a month after you asked this question, you may have already resolved this issue. However I would post the answer here for future reference. Short answer is that, Attach ...
user avatar
18 votes
Accepted

Better editorial image manipulation tools in Sitecore CMS

We had exactly this problem to solve on the current project that I'm working on. I wanted to use something like this for Umbraco which allows you to set a focus point: https://our.umbraco.org/...
user avatar
18 votes

How do you get the link for a media item?

Getting the URL of a MediaItem is pretty straightforward, you pass the MediaItem reference to Sitecore.Resources.Media.MediaManager.GetMediaUrl: var url = MediaManager.GetMediaUrl(mediaItem); ...
user avatar
  • 863
17 votes
Accepted

How do you get the link for a media item?

This will also fold in protection for the media request: var theURL = Sitecore.Resources.Media.MediaManager.GetMediaUrl(mediaItem); mediaUrl = Sitecore.Resources.Media.HashingUtils.ProtectAssetUrl(...
user avatar
  • 1,279
17 votes

How can I safely clear the media cache on a production sitecore CD instance?

Other option is to delete from time to time media cache using an schedule agent. Current value is 24 days but if you need to clear more ofen just decrease max age parameter of the last setting (see ...
user avatar
  • 17.7k
17 votes

How to upload an image programmatically from URL

There are a couple of steps involved. Download the image from the url via a WebRequest Copy the download stream to a MemoryStream Set up a MediaCreator Configure MediaCreatorOptions Create the ...
user avatar
  • 24.3k
16 votes
Accepted

How can I safely clear the media cache on a production sitecore CD instance?

It is completely safe to just delete the folder /App_data/MediaCache without causing disruption. The minute an image gets called up again, it will be cached again, so no worries about the ...
user avatar
16 votes

Sitecore media ashx not resizing the image (version 7.2)

As of Sitecore 7.5+ (applies to the latest 7.2 versions as well), Sitecore introduced a media request protection for image resizing (to make sure an attacker can't overload your server with image ...
user avatar
15 votes
Accepted

How to default the media browser to tree view

In Sitecore 7.1-7.5 there is a configuration file called Sitecore.Speak.config in the include folder. In that file find the following line: <override xmlControl="Sitecore.Shell.Applications.Media....
user avatar
  • 1,304
14 votes

Improve image compression using Dianoga

Your comparison of Dianoga with the other tools isn't quite fair- though what you found is accurate. A few things to point out: Dianoga is lossless compression, which means as the size is reduced, ...
user avatar
  • 4,691
13 votes
Accepted

How do I enforce Alt tags on all images in Sitecore

You are able to set the required validation item rule item to FATAL ERROR in Sitecore. This is the highest level of validation. This setting prevent the user to save the item with validation error.
user avatar
12 votes

Convert disk based media to database

You have a few good options. Module: You were probably looking for this. https://marketplace.sitecore.net/en/Modules/Media_Conversion_Tool.aspx Custom Code I would convert the code in this ...
user avatar
  • 16.4k
11 votes
Accepted

Optimizing Sitecore Media Items

You've got a few options: The Simple Option: Add a width (see here: Sitecore Image Parameters) - the image sizes will be processed. The disadvantage of this approach is that you get a processing hit ...
user avatar
  • 1,502
11 votes
Accepted

What is the purpose of shared tenant media folder in SXA?

sitecore/media library/Project/New tenant - this is media folder created for your project. In this example your project is called "New tenant" sitecore/media library/Project/New tenant/shared media ...
user avatar
10 votes

Optimizing Sitecore Media Items

You could also use this... https://github.com/kamsar/Dianoga An automatic image optimizer for the Sitecore media library.
user avatar
10 votes
Accepted

MediaRequestProtection: An invalid/missing hash value was encountered

It usually means that a Url for a media asset is missing the Hash query string parameter when being called. This was introduced in v7.5. It attempts to fix an image resize vunerability where you ...
user avatar
  • 18.8k
10 votes
Accepted

Unable to see entire Sitecore content tree on selecting any media library item

Click on the Sitecore Icon present on the top left in Content Editor then navigate to: Application options ▶ View(2nd tab) ▶ Check the Show Entire Content Tree check box.
user avatar
9 votes

MediaRequestProtection: An invalid/missing hash value was encountered

Yes. Likely your solution is not generating protected Media Urls. Used to be: var mediaUrl = Sitecore.Resources.Media.MediaManager.GetMediaUrl(mediaItem) Was enough. But to protect against XSS ...
user avatar
  • 24.3k
9 votes
Accepted

Multiple images upload failing in Chrome and Firefox

I saw this behavior when you have a firewall, antivirus or cookies are corrupted. Somehow Please try to delete all your cookies and try again. Cookie with key : sc_fv contains Flash Version and ...
user avatar
  • 17.7k
9 votes

Access denied security roles on media attach

Another option is to add the user in question to the Sitecore Client Maintaining role as it already has read access to the upload dialog box. No need to edit security in the core DB with this route. ...
user avatar
9 votes
Accepted

SPE How to add multiple items to package source

The script we use to bundle up SPE can be found here: /sitecore/system/Modules/PowerShell/Script Library/Platform/Development/PowerShell Extensions Maintenance/Prepare Console Distribution. From the ...
user avatar
  • 16.4k
8 votes
Accepted

How do I manage Media library file extensions for SEO purposes?

Loooong time ago I wrote a blog post describing how to handle this issue. It was for Sitecore 6.5 but I guess it should work on any other version as well. Sitecore serves media items even with ...
user avatar
8 votes
Accepted

Sitecore Publishing Service 1.8.0 does not publish blob data for custom field using type Attachment

By default, the publishing service will publish Blobs if they are created/referenced by the following fields: /sitecore/templates/System/Media/Versioned/File/Media/Blob Guid = {DBBE7D99-1388-4357-...
user avatar
8 votes
Accepted

Is there a GetDefaultMediaUrlOptions function?

No, there is not. mediaProvider definition in Sitecore is limited to <mediaProvider type="Sitecore.Resources.Media.MediaProvider, Sitecore.Kernel" /> while LinkProvider definition contains ...
user avatar
8 votes
Accepted

How to disable caching for specific items in the Media Library?

I would recommend solving this by embracing HTTP caching by changing the Cache-Control to no-cache. The browser will then always check to see if there's a newer/different version but since media items ...
user avatar
8 votes
Accepted

Override Media Manager to Change Url

You need register the new Media Manager using Sitecore Dependency Injection (see 'Registration in code' chapter). It can be done via Service Configurator as described in the article. Creating Service ...
user avatar
8 votes
Accepted

SXA what is the purpose of the Media folder under a Site

Media Library scope for site Every dialog where you have to select media item will be scoped to Media (Virtual Media Folder) So first and very important role is to scope which part of Media Library ...
user avatar
8 votes

Uploading zip file to Media Library and enabling "unpacking" results in an error

This is a problem with zip archives generated on Macs. Sitecore zipping mechanis doesn't work well with zip archives containing __MACOSX folder. As a workaround you can unzip your archive on PC, ...
user avatar
7 votes

MediaRequestProtection: An invalid/missing hash value was encountered

I did some digging: Sitecore has a mechanism to ensure the validity of dynamically scaled media requests. Read more about this here: https://doc.sitecore.net/sitecore_experience_platform/...
user avatar
  • 1,279
7 votes
Accepted

Sitecore Media request Protection hashing with srcset attribute

It looks like your problem is the 1x being before the hash parameter - that part doesn't need to be included in the hash. Try changing to this: <img class="callout-grid__image" srcset="@...
user avatar
  • 18.8k

Only top scored, non community-wiki answers of a minimum length are eligible