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 …

  • <!DOCTYPE html> <html> <head> <title></title> </head> <body> <p>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 …</p> </body> </html>
  • Murray Adcock.
Journal permalink