3b2d4b38af
when downloading a file (attachment) that's on S3, include the response-content-disposition parameter in the redirect url so that the user will get a Content-Disposition header from S3 giving the file the correct disposition (attachment, not in-browser) and the correct filename (the 'natural' filename in S3 is that of the first copy of the file uploaded; someone else may have uploaded it again with a different filename; we want them to see the correct filename in the download). CAVEATS: * in the case of duplicate files with different filenames, the content disposition will cause the correct filename to be used by the browser in saving/prompting-to-save the file, but the actual S3 filename will still be present in the URL if inspected. * the filename in the content-disposition is correctly quoted as per RFC 2616 for ASCII, but a lot of browsers do it wrong. we are making no attempt to accomodate their idiosyncracies. * the http quoting we do is ghetto and doesn't account for multi-byte characters. fixes #4473 Change-Id: I468a6ecdaee2946ab89172984adacf20b491d541 Reviewed-on: https://gerrit.instructure.com/6506 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: Cody Cutrer <cody@instructure.com> |
||
---|---|---|
.. | ||
coffeescripts | ||
controllers | ||
helpers | ||
messages | ||
middleware | ||
models | ||
stylesheets | ||
views |