Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 generate signed downloading url is not using response headers #3119

Closed
peterneyens opened this issue Apr 30, 2015 · 1 comment
Closed

Comments

@peterneyens
Copy link
Contributor

I'm trying to generate a download url for an S3 file/key and want to change the filename when the downloaded file is saved locally (using the Content-Disposition header).

disposition = "attachment; filename=\"{}\"".format(file_name)
response_headers = {
    'response-content-disposition': disposition
}
key.generate_url(60 * 60, query_auth=True, response_headers=response_headers)

The key.generate_url method uses the s3.connection.generate_url_sigv4 method and this function doesn't seem to use the response_headers argument, so my Content-Disposition header is not used in the response.

In the normal s3.connection.generate_url, the response headers are added to the query path like described in the S3 documentation.

Kind regards,
Peter

@joelcox
Copy link

joelcox commented Jan 27, 2016

Thanks for this fix @peterneyens.

jamesls added a commit that referenced this issue Feb 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants