From 6d0c4c8e44e6fef56dd6f134318cd54ef5240212 Mon Sep 17 00:00:00 2001 From: Lucas Ocon Date: Fri, 24 Jun 2022 17:46:36 -0300 Subject: [PATCH] Update README file Add example to get a download url --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index af19de5d6..0a77d9cc4 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,20 @@ directory.files 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 When using IAM authentication with