Open aaongr opened 4 years ago
I do not know if this is an issue of this gem... It could be an issue of the caller (shrine gem)
I forked-cloned this gem
Log - this is the initialization:
*** [shrine-cloudinary] initialize - prefix: "cache", type: upload
upload_options: {}
=========================
*** [shrine-cloudinary] initialize - prefix: nil, type: upload
upload_options: {}
=========================
Log - the first upload has the correct upload_options:
*** [shrine-cloudinary] upload - io: #<File:0x00007fd572a80aa8>, id: 0527540cf7686c37db9c678e4a88bb90.jpg
shrine_metadata: {"filename"=>"dirfis-apoksiramena-aourikoularia-30g_585x585.jpg", "size"=>54491, "mime_type"=>"image/jpeg"}
upload_options: {:folder=>"aaa"}
=========================
Log - the second upload missing the correct upload_options:
*** [shrine-cloudinary] upload - io: #<AttachmentUploader::UploadedFile:0x00007fd57401b660>, id: 0ab93ba604f7b96f28f84ffbf40b4bba.jpg
shrine_metadata: {"filename"=>"dirfis-apoksiramena-aourikoularia-30g_585x585.jpg", "size"=>54491, "mime_type"=>"image/jpeg", "width"=>585, "height"=>585}
upload_options: {}
=========================
*** [shrine-cloudinary] store - options: {:public_id=>"0ab93ba604f7b96f28f84ffbf40b4bba"}
=========================
Hello,
I am using latest shrine-cloudinary v1.1.1, with Shrine v3.2.2 in Rails 6.3.2 and Ruby 2.6.5...
config/initializers/shrine.rb
I want to have the ability to upload from remote urls and to set the folder in every upload (multi-tenant app)
If I use:
The cache gets created inside folder 'aaa' but I get the error:
Probably when It moves the file from the cached folder it does not use the specified folder and this must be the reason for the exception...
I try also the following, but the problem persists:
If I use:
then the file gets uploaded in the root folder in cloudinary and the cache file in 'cache' folder (this is not what I want)...
Any ideas?
With my warmest regards for all of Us... :)