This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -I https://yoursite.com/~/media/Documents/Factsheet.ashx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void SetAttachmentDisposition(HttpResponse response, string name, string extension) | |
| { | |
| string filename = $"{name}.{extension}"; | |
| string encoded = Uri.EscapeDataString(filename); | |
| response.Headers["Content-Disposition"] = $"attachment; filename=\"{filename}\"; filename*=UTF-8''{encoded}"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8" ?> | |
| <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
| <sitecore> | |
| <mediaLibrary> | |
| <mediaProvider type="MyProject.Foundation.Media.CustomMediaProvider, MyProject.Foundation.Media" patch:instead="*[@type='Sitecore.Resources.Media.MediaProvider, Sitecore.Kernel']" /> | |
| </mediaLibrary> | |
| </sitecore> | |
| </configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Sitecore.Resources.Media; | |
| namespace MyProject.Foundation.Media | |
| { | |
| public class CustomMediaProvider : MediaProvider | |
| { | |
| public override Media GetMedia(MediaUri mediaUri) | |
| { | |
| var media = base.GetMedia(mediaUri); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Sitecore.Resources.Media; | |
| using Sitecore.Data.Items; | |
| using System.Web; | |
| namespace MyProject.Foundation.Media | |
| { | |
| public class CustomMedia : Media | |
| { | |
| private const string ForceDownloadFieldName = "Force Download"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $user = Get-User -Current | |
| $serializedData = $user.Profile.GetPropertyValue("SerializedData") | |
| if ($serializedData -is [System.Collections.IDictionary]) { | |
| # Update the key based on previous script output | |
| $gutterKey = "$($user.LocalName)/Content Editor/Gutter Renderers" | |
| Write-Host "Looking for key: $gutterKey" -ForegroundColor Yellow | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $user = Get-User -Current | |
| Write-Host "User: $($user.Name)" -ForegroundColor Cyan | |
| Write-Host "========================`n" -ForegroundColor Cyan | |
| $profile = $user.Profile | |
| $propertiesCollection = $profile.Properties | |
| Write-Host "Found $($propertiesCollection.Count) properties`n" -ForegroundColor Yellow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT [UserName], [Value] | |
| FROM [dbo].[aspnet_Profile] | |
| WHERE [PropertyValuesString] LIKE '%BrokenLinks%' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| EXEC sp_MSforeachdb ' | |
| IF ''?'' LIKE ''%Xdb.Collection.Shard%'' | |
| BEGIN | |
| USE [?]; | |
| SELECT | |
| DB_NAME() AS DatabaseName, | |
| name AS FileName, | |
| type_desc AS FileType, | |
| size/128 AS CurrentSizeMB, | |
| size/128.0 - CAST(FILEPROPERTY(name, ''SpaceUsed'') AS INT)/128.0 AS FreeSpaceMB, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| window.toggleOverlayPanel = function() {{ | |
| var panel = document.getElementById('scxmPanel'); | |
| if (!panel) return; | |
| var isOpen = panel.classList.toggle('open'); | |
| try {{ | |
| panel.setAttribute('aria-hidden', !isOpen); | |
| localStorage.setItem('scxmPanelOpen', isOpen ? '1' : '0'); | |
| }} catch(e) {{ |
NewerOlder