Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. def presigned_upload
  2. # ${filename} is a placeholder that S3 will automatically replace with the
  3. # original filename.
  4. storage_path = generate_storage_path('${filename}')
  5.  
  6. presigned_post = s3_bucket.
  7. presigned_post(key: s3_object_key(storage_path))
  8.  
  9. {
  10. storage_path: storage_path,
  11. url: presigned_post.url,
  12. fields: presigned_post.fields
  13. }
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement