Skip to content

file_storage: S3 presigned downloads lack Content-Disposition, so files save under their storage key #489

Closed

Description

@antosubash

modules/file_storage/file_storage/backends/s3.py presigned_get_url() calls generate_presigned_url("get_object", Params={"Bucket", "Key"}) with no ResponseContentDisposition (or ResponseContentType). The streamed path in serving.py sets those headers, but on a presigning backend the browser is redirected to S3 and saves the file under its opaque storage key instead of its original filename.

Fix direction: pass ResponseContentDisposition (RFC 6266/5987-encoded original filename, attachment vs inline as the streamed path decides) and ResponseContentType through presigned_get_url; add a test asserting the presigned URL carries both.

Found during the multipart upload work (#454, #483).

https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions