Uploading multiples files of different types via a single upload preset
We are developing our own UI for uploading files where a user can drag and drop any file type (image, video, audio, raw binary files) which we upload. We're then subscribing to the upload callback to store the "asset type" for building transformation URLs correctly later.
We are using an upload preset so run a virus scan moderation on all of the files, which means we apply that upload preset to every file regardless of type.
We now need to eagerly transform videos for adaptive streaming (large files which cannot be done on the fly).
Is it the "correct" way to simply add that eager transformation to our upload preset which is applied to _all_ files, including non-video?
We don't want to have to amend our upload pipeline and maintain separate upload presets for different asset types if we can avoid it.
-
Hi Nick.
I'm Danny, and I'm one of the Developer Support Engineers here at Cloudinary.
The approach you're taking is definitely the way I would suggest doing things if you want to use a single upload preset. Any eager transformations that simply can't be done due to the resource type (ie trying to apply video encoding to a PDF file) are ignored.
Using separate upload presets for image/video/raw files is a fairly common use-case, but using a single preset for all three in the way that you have is perfectly acceptable and shouldn't cause any issues.
Let us know if you have any further questions, and if you'd like to discuss any details that are exclusive to your account such as cloud name, upload preset name, etc, you would be welcome to raise a support ticket if you would prefer.
Thanks,
-Danny
Post is closed for comments.
Comments
3 comments