1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00

Update README file

Add example to get a download url
This commit is contained in:
Lucas Ocon 2022-06-24 17:46:36 -03:00 committed by GitHub
parent e07f5a0d3e
commit 6d0c4c8e44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,6 +106,20 @@ directory.files
directory.files.new(key: 'user/1/Gemfile').url(Time.now + 60) directory.files.new(key: 'user/1/Gemfile').url(Time.now + 60)
``` ```
##### Generate download URL
You should pass an option arguyment that contains the `query` key with `response-content-disposition` inside indicating that is an attachment and the filename to be used when downloaded.
```ruby
options = {
query: {
'response-content-disposition' => "attachment; filename=#{key}"
}
}
directory.files.new(key: 'user/1/Gemfile').url(Time.now + 60, options)
```
##### Controlling credential refresh time with IAM authentication ##### Controlling credential refresh time with IAM authentication
When using IAM authentication with When using IAM authentication with