resource_type: 'auto' not required?
I am using a URL like this for uploads of both image and raw files:
https://api.cloudinary.com/v1_1/bidlogix-test/upload
It works fine.
However, in a couple of places in the documentation there is mention that resource_type should be set to auto.
For example here: http://cloudinary.com/documentation/upload_images#remote_upload
But I am not setting that. If I do set that, it appears to have no effect.
So the questions are:
Should I be setting that?
If not, is it entirely redundant now?
If it's not redundant, what are the circumstances where it is needed?
-
Hi David.
When you use a URL like:
https://api.cloudinary.com/v1_1/bidlogix-test/image/upload
This tells Cloudinary that you're uploading a resource of type
image
. All non-image file upload attempts will be returned with an error.If you wish to upload a non-image file, you should set the resource type to
raw
, e.g.,:https://api.cloudinary.com/v1_1/bidlogix-test/raw/upload
Alternatively, Cloudinary offers the option to have a single endpoint for all resource types. Cloudinary will automatically detect whether the uploaded file is an image or not and will handle it accordingly. This is done by setting the resource type to
auto
, e.g.,:https://api.cloudinary.com/v1_1/bidlogix-test/auto/upload
For more information:
http://cloudinary.com/blog/using_cloudinary_to_manage_all_your_website_s_assets_in_the_cloud1 -
Okay thanks for the info but the URL I am using is generated by the Cloudinary jQuery plugin and is simply:
https://api.cloudinary.com/v1_1/bidlogix-test/upload (nothing between 'bidlogix-test/' and 'upload')
Which doesn't match any of the URLs you mention.
So I am asking those questions about that URL :)
In other words: Should I be setting that option within the jQuery plugin?
Or to put it another way - do I need to take any notice of that setting if am using the jQuery plugin? Because I can set it using the plugin - it just doesn't seem to have any effect.
0 -
If you know in advanced the uploaded resources's type, it's recommended to explicitly tell Cloudinary which one is it. If not, you may indeed either set as
auto
, or set nothing (as you did) which is automatically defaulted to behave as ifauto
was set.0 -
Thanks Itay! If there is nothing to gain, and no harm in leaving it out, I'll leave it out when using the plugin then :)
0
Post is closed for comments.
Comments
4 comments