Rails Active Storage: Upload Raw file
Hi,
We are using Cloudinary Rails gem with Active Storage.
Files are uploaded correctly to Cloudinary and when file is image or PDF then links are generated correctly like below.
http://res.cloudinary.com/account_name/image/upload/v1/file_name.abc
When file extension is something else like document or excel then it's uploaded to Cloudinary but file URL still returned by Active Storage as it is image like above but in Cloudinary it shows as follow:
http://res.cloudinary.com/account_name/raw/upload/v1/file_name.abc
Model
class Item < ApplicationRecord
has_one_attached :documentend
To get url:
item.document.url
When Active Storage service is set to Cloudinary then it doesn't seem to return correct URL when Cloudinary resource_type is raw. URL always has "image" in it instead of "raw". Is there any parameter we can set to get correct URL in case of raw files?
-
Hi Sharjeel,
Thanks for reporting this.
Could you please confirm which version of the Cloudinary Ruby Gem you have installed? Also, does this happen for direct client-side uploads with ActiveStorage and/or also for ones performed from the server-side?
There were some updates in regards to Raw files uploaded through ActiveStorage in a few earlier versions and it would help to know which version you're using for us to verify.
0
Post is closed for comments.
Comments
1 comment