The documentation says about retrieve_from_store!
:
Retrieves the file from the storage.
But when I call the method, rather than getting something like a file, I just get an array returned:
irb(main):008:0> uploader.retrieve_from_store!('my_file.png')
=> [:retrieve_versions_from_store!]
What exactly does the method do?
I was looking for the same thing today. Found something from Jonas Nicklas in the CarrierWave forum here...
retrieve_from_store!
changes the state of the uploader, it doesn't return anything sensible. You want to do this:
uploader.retrieve_from_store!('test.jpg')
uploader.do_whatever
The return value from
retrieve_from_store!
is irrelevant.
I just needed to use model.uploader.read
to get to the bytes. It seems, uploader delegates to the file via Proxy
: https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/uploader/proxy.rb#L43
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With