Search code examples
ruby-on-railsruby-on-rails-6cloudinary

Uploading .zip file to Cloudinary using Ruby on Rails


I have Cloudinary API added to my Rails 6 application. Photo extensions and video extension uploads work great. .zip extensions do not. I've run into two errors while trying to upload a zip file.

  • CloudinaryException (Unsupported ZIP file):
  • ActiveModel::UnknownAttributeError (unknown attribute 'type' for Photo.)

In my controller for uploading the zip file, I tried to upload a zip file in different ways.

First I tried

  @value = Cloudinary::Uploader.upload(params[:downloadable],
  folder: "game_zip", resource_type: :raw)

Second I tried

  @value = Cloudinary::Uploader.upload(params[:downloadable])

Third I tried

@value = Cloudinary::Uploader.upload(params[:downloadable],
:resource_type => :auto)

I read in Cloudinary documents that using raw file types is how you can upload zip files, I tried what they recommended, but it's not working. Is there a solution or option that I need to add?


Solution

  • Cloudinary recently updated its security policies, and now restricts both pdf and archive file types on new Free accounts.

    This can be bypassed by contacting Cloudinary's support, or by upgrading your account.