This PR should fix this by:
- adding a
data-download-hrefto the lightbox download link when S3 uploads are enabled - the URL used is the new short URL scheme with a
dl=1parameter that will make the controller generate a presigned S3 URL with the correct content disposition and filename
In other words, the download link in the lightbox will now look like /uploads/short-url/mTGbg4Ld2iBYAbfTvEjGXP2LtVm.pdf?dl=1, which will redirect to a signed S3 URL with content-disposition: "attachment; filename=original.png".
I think this is the simplest and most direct option, proxying through the app would be a tiny bit less efficient because the downloaded file would have to go from S3 to the Discourse server to the client.