Download allows linking to an asset for download. Optionally displays a title, description, metadata and a download action.
Simple Download with only an Action Text and Download Asset configured. The Title and Description are by default taken from the provided asset.
- jcr:primaryType: nt:unstructured
- jcr:createdBy: admin
- fileReference: /content/dam/core-components-examples/library/sample-assets/lava-into-ocean.jpg
- jcr:lastModifiedBy: admin
- jcr:created: java.util.GregorianCalendar[time=1558435792210,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=sun.util.calendar.ZoneInfo[id="GMT+02:00",offset=7200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2019,MONTH=4,WEEK_OF_YEAR=21,WEEK_OF_MONTH=4,DAY_OF_MONTH=21,DAY_OF_YEAR=141,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=3,AM_PM=1,HOUR=0,HOUR_OF_DAY=12,MINUTE=49,SECOND=52,MILLISECOND=210,ZONE_OFFSET=7200000,DST_OFFSET=0]
- jcr:lastModified: java.util.GregorianCalendar[time=1558440888583,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=sun.util.calendar.ZoneInfo[id="GMT+02:00",offset=7200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2019,MONTH=4,WEEK_OF_YEAR=21,WEEK_OF_MONTH=4,DAY_OF_MONTH=21,DAY_OF_YEAR=141,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=3,AM_PM=1,HOUR=2,HOUR_OF_DAY=14,MINUTE=14,SECOND=48,MILLISECOND=583,ZONE_OFFSET=7200000,DST_OFFSET=0]
- sling:resourceType: core/wcm/components/download/v1/download
- titleFromAsset: true
- textIsRich: true
- actionText: Download
- descriptionFromAsset: true
By default, the Title and Description are taken from the provided asset. In this example, we provide a custom title and description for the download.
- jcr:primaryType: nt:unstructured
- jcr:createdBy: admin
- jcr:title: Custom Title
- fileReference: /content/dam/core-components-examples/library/sample-assets/lava-into-ocean.jpg
- jcr:lastModifiedBy: admin
- inline: false
- jcr:created: java.util.GregorianCalendar[time=1558435792210,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=sun.util.calendar.ZoneInfo[id="GMT+02:00",offset=7200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2019,MONTH=4,WEEK_OF_YEAR=21,WEEK_OF_MONTH=4,DAY_OF_MONTH=21,DAY_OF_YEAR=141,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=3,AM_PM=1,HOUR=0,HOUR_OF_DAY=12,MINUTE=49,SECOND=52,MILLISECOND=210,ZONE_OFFSET=7200000,DST_OFFSET=0]
- jcr:description: <p>Custom description</p>
- jcr:lastModified: java.util.GregorianCalendar[time=1558992130786,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=sun.util.calendar.ZoneInfo[id="GMT+02:00",offset=7200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2019,MONTH=4,WEEK_OF_YEAR=22,WEEK_OF_MONTH=5,DAY_OF_MONTH=27,DAY_OF_YEAR=147,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=11,HOUR_OF_DAY=23,MINUTE=22,SECOND=10,MILLISECOND=786,ZONE_OFFSET=7200000,DST_OFFSET=0]
- sling:resourceType: core/wcm/components/download/v1/download
- titleFromAsset: false
- textIsRich: true
- actionText: Download
- descriptionFromAsset: false
It is possible to upload an asset directly from a local file system rather than selecting an asset from DAM.
Asset uploaded directly from a local file system
- jcr:primaryType: nt:unstructured
- jcr:createdBy: admin
- jcr:title: Uploaded Asset
- jcr:lastModifiedBy: admin
- fileName: lava-into-ocean.jpg
- jcr:created: java.util.GregorianCalendar[time=1558435792210,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=sun.util.calendar.ZoneInfo[id="GMT+02:00",offset=7200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2019,MONTH=4,WEEK_OF_YEAR=21,WEEK_OF_MONTH=4,DAY_OF_MONTH=21,DAY_OF_YEAR=141,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=3,AM_PM=1,HOUR=0,HOUR_OF_DAY=12,MINUTE=49,SECOND=52,MILLISECOND=210,ZONE_OFFSET=7200000,DST_OFFSET=0]
- jcr:description: <p>Asset uploaded directly from a local file system</p>
- jcr:lastModified: java.util.GregorianCalendar[time=1558992253561,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=sun.util.calendar.ZoneInfo[id="GMT+02:00",offset=7200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2019,MONTH=4,WEEK_OF_YEAR=22,WEEK_OF_MONTH=5,DAY_OF_MONTH=27,DAY_OF_YEAR=147,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=11,HOUR_OF_DAY=23,MINUTE=24,SECOND=13,MILLISECOND=561,ZONE_OFFSET=7200000,DST_OFFSET=0]
- sling:resourceType: core/wcm/components/download/v1/download
- titleFromAsset: false
- textIsRich: true
- actionText: Download
- descriptionFromAsset: false
Asset uploaded directly from a local file system
- Filename
- lava-into-ocean.jpg
- Size
- 81 KB
- Format
- image/jpeg
Download
By default the asset is downloaded directly, but it is also possible to display it inline in the browser.
- jcr:primaryType: nt:unstructured
- jcr:createdBy: admin
- fileReference: /content/dam/core-components-examples/library/sample-assets/lava-into-ocean.jpg
- jcr:lastModifiedBy: admin
- inline: true
- jcr:created: java.util.GregorianCalendar[time=1558435792210,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=sun.util.calendar.ZoneInfo[id="GMT+02:00",offset=7200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2019,MONTH=4,WEEK_OF_YEAR=21,WEEK_OF_MONTH=4,DAY_OF_MONTH=21,DAY_OF_YEAR=141,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=3,AM_PM=1,HOUR=0,HOUR_OF_DAY=12,MINUTE=49,SECOND=52,MILLISECOND=210,ZONE_OFFSET=7200000,DST_OFFSET=0]
- jcr:lastModified: java.util.GregorianCalendar[time=1558992253561,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=sun.util.calendar.ZoneInfo[id="GMT+02:00",offset=7200000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2019,MONTH=4,WEEK_OF_YEAR=22,WEEK_OF_MONTH=5,DAY_OF_MONTH=27,DAY_OF_YEAR=147,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=11,HOUR_OF_DAY=23,MINUTE=24,SECOND=13,MILLISECOND=561,ZONE_OFFSET=7200000,DST_OFFSET=0]
- sling:resourceType: core/wcm/components/download/v1/download
- titleFromAsset: true
- textIsRich: true
- actionText: View
- descriptionFromAsset: true