tpyo / amazon-s3-php-class

A standalone Amazon S3 (REST) client for PHP 5/CURL
1.03k stars 504 forks source link

New function to get an authenticated object URL for download. #125

Closed majorcode closed 7 years ago

majorcode commented 8 years ago

This change adds getAuthenticatedDownloadURL(), a variation of getAuthenticatedURL(), with a content disposition added to trigger downloading the object when the URL is opened.

tpyo commented 7 years ago

Thanks for the PR, issue would solved with #108 which is a better approach, closing this.

majorcode commented 7 years ago

Is it really a better approach? I like the additional parameter for custom headers. But, the additional, noisy syntax required to include custom headers is not as simple when you're really just interested in getting a URL that'll trigger a download--something I think would be a common desire. I think having a function named getAuthenticatedDownloadURL is friendly API design.

I admit that my patch caused duplication. It was important to me to avoid touching your original code. I considered adding something like #108, but I liked the fully named function for ease of use.

Why not add a function named getAuthenticatedDownloadURL which calls the new function from #108 with the same signature and merges in the content disposition header?