Netlify redirects and downloads | adactio

I didn't know that the <a> element had a download attribute, nor that it could rename the file on download for you e.g:

<a href="/files/ugly-file-name.xyz" download="nice-file-name.xyz">download</a>

On top of which, I didn't know that redirects using Netlify's _redirects file (which IĀ do know about šŸ˜€) would allow for same-domain downloads (which the download attribute requires):

/download/*  https://clearleft-audio.s3.amazonaws.com/podcast/:splat  200

Basically, this whole article is a TIL.

Explore Other Notes

Older āž”

SVG OMG!

SVG OMG is a brilliant (and free) web tool for sanitising, standardising, and minifying SVG assets. It's brilliant and has saved me a few times […]
  • I didn't know that the &lt;a&gt; element had a download attribute, nor that it could rename the file on download for you [&#8230;]
  • Murray Adcock.
Journal permalink

Made By Me, But Made Possible By:

CMS:

Build: Gatsby

Deployment: GitHub

Hosting: Netlify

Connect With Me:

Twitter Twitter

Instagram Instragram

500px 500px

GitHub GitHub

Keep Up To Date:

All Posts RSS feed.

Articles RSS feed.

Journal RSS feed.

Notes RSS feed.