shrinerb / shrine-cloudinary

Cloudinary storage for Shrine
https://cloudinary.com/
MIT License
23 stars 6 forks source link

Large files presign upload #7

Open jaahoo opened 4 years ago

jaahoo commented 4 years ago

Hi, I am using Uppy AWS S3 for direct upload. I can easily upload files smaller than 100 MB but larger files immediately crash with: "Access to XMLHttpRequest at 'https://api.cloudinary.com/v1_1/CLOUD_NAME/video/upload' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."

janko commented 4 years ago

I'm guessing that 100MB is Cloudinary's limit for simple uploads (single request), and from then onward it requires special multipart uploads. I know that Cloudinary has special endpoint(s) for large uploads, but I don't know how to correctly do direct uploads to them. I'm not sure if this strategy is compatible with Shrine's presign endpoint, as it is intended for single upload request, and I think Cloudinary's large file support might require multiple.

You could investigate how Cloudinary's official upload widget is handling large files, and maybe that could tell us what is the specific problem and whether we can solve it.

petrbela commented 4 years ago

If you're on the free plan, Cloudinary limits you to 10MB image uploads and 100MB video uploads. I think that's what you're hitting; although the multipart explanation might hold true, too.