Skip to content

Commit

Permalink
Support chunked uploads with CarrierWave
Browse files Browse the repository at this point in the history
  • Loading branch information
taragano committed Apr 1, 2024
1 parent 35d8d32 commit 088330b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cloudinary/carrier_wave/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def store!(file)
params[:type]=uploader.class.storage_type

params[:resource_type] ||= :auto
uploader.metadata = Cloudinary::Uploader.upload(data, params)
upload_method = uploader.upload_chunked? ? "upload_large" : "upload"
uploader.metadata = Cloudinary::Uploader.send(upload_method, data, params)
if uploader.metadata["error"]
raise Cloudinary::CarrierWave::UploadError.new(uploader.metadata["error"]["message"], uploader.metadata["error"]["http_code"])
end
Expand Down

0 comments on commit 088330b

Please sign in to comment.