DFS 10.4.0 - Changing download filename
When requesting an download form DAM of Sitecore media handler, the default file will be the assets title (name).extension. The setting can be found in the file:Ā App_Config\Include\damforsitecore\DFS.Settings.config and look for the parameter setting DFS.MediaPipeline.downloadFilename.mask.
<setting name="DFS.MediaPipeline.downloadFilename.mask" value="{stampvalue-asset:name}" />
The possible stampvalue tags can be found hereĀ DFS 10.4.0 - 3 Render DAM for Sitecore Field TypesĀ section 3.5 and hereĀ Ā DFS 10.4.0 - 4 Accessing metadata through API.
Examples:Ā
I want the file to contain title and selected quality id.
<setting name="DFS.MediaPipeline.downloadFilename.mask" value="{stampvalue-asset:name}-{stampvalue-selected:quality}" />
Output: Penguins-50051.jpg
I want to prefix all download names with the tag DFS.
<setting name="DFS.MediaPipeline.downloadFilename.mask" value="DFS-{stampvalue-asset:name}" />
Output: DFS-Penguins.jpg
I want the file to contain the photograph name, in this example is has the metafieldId 50055.
<setting name="DFS.MediaPipeline.downloadFilename.mask" value="Download-{stampvalue-asset:name}-{stampvalue-asset:50055}" />
Output:Ā Penguins-John doe.jpg