简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM