0

Shrine creates a random ID for the uploaded file to AWS S3 when calling presign_endpoint. Is there a way to change the way the ID is generated using Shrine's configuration?

jpac
  • 69
  • 5

1 Answers1

0

Yes, you can use :presign_location:

Shrine.plugin :presign_endopint, presign_location: -> (request) do
  "#{SecureRandom.hex}/#{request.params["filename"]}" # for example
end
Janko
  • 8,985
  • 7
  • 34
  • 51