Skip to content

Instantly share code, notes, and snippets.

@mhawkins
Created November 2, 2009 23:16
Show Gist options
  • Select an option

  • Save mhawkins/224606 to your computer and use it in GitHub Desktop.

Select an option

Save mhawkins/224606 to your computer and use it in GitHub Desktop.
Generate expiring URLs for private S3 files.
module Paperclip::Storage::S3
def expiring_url(time = 3600)
AWS::S3::S3Object.url_for(path, bucket_name, :expires_in => time )
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment