Skip to main content

resource_type: 'auto' not required?

Comments

4 comments

  • Itay Taragano

    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_cloud

    1
  • Adam Taylor

    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
  • Itay Taragano

    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 if auto was set.

    0
  • David Wood

    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.