Link Search Menu Expand Document

Download Parameter (dl)

Make your images downloadable with a simple URL parameter


Table of contents


Overview

The dl parameter allows you to control whether an image is displayed in the browser or downloaded automatically. When enabled, the browser will prompt the user to download the image instead of displaying it.

Usage

Add ?dl=1 to any HCTI.io image URL to make it downloadable:

https://hcti.io/v1/image/7cb776c5-8c12-4b1a-84aa-9941b815d873.jpg?dl=1

Implementation Examples

Create a download button or link:

<a href="https://hcti.io/v1/image/7cb776c5-8c12-4b1a-84aa-9941b815d873.jpg?dl=1" 
   class="download-button">
  Download Image
</a>

JavaScript Download Trigger

Programmatically trigger a download:

function downloadImage(imageId) {
  const downloadUrl = `https://hcti.io/v1/image/${imageId}?dl=1`;
  window.location.href = downloadUrl;
}

Common Use Cases

  • Creating downloadable certificates or badges
  • Offering high-resolution versions of images
  • Generating downloadable reports or charts
  • Providing image assets for users

File Format Tip

The dl parameter works with all supported formats (jpg, png, webp). The downloaded file will maintain the extension specified in the URL.


Need help?

Talk to a human. Please email us support@htmlcsstoimage.com with any questions and we’ll gladly help you get started.


Back to top

Built with extensive integration tests and serious care for developer happiness.
© 2018-2024 Code Happy, LLC.

Page last modified: Dec 26 2024 at 02:39 PM.

Edit this page on GitHub.