androidparse-platformcloudinary

Cloudinary Invalid image file exception


Cloudinary only has an example for how to load images from android to the cloud. However I need to upload videos. When I use the call from the sample code I get an Invalid image file error. Here is the call that throws the exception

Map cloudinaryResult=cloudinary.uploader().upload(file, uploadParams);

Does anyone know the call for uploading videos instead of photos? I am using Cloudinary with Parse.com

Here is the stack trace

java.lang.RuntimeException: Invalid image file
            at com.cloudinary.android.UploaderStrategy.callApi(UploaderStrategy.java:101)
            at com.cloudinary.Uploader.callApi(Uploader.java:22)
            at com.cloudinary.Uploader.upload(Uploader.java:55)

Solution

  • You should add

    uploadParams.put("resource_type", "video")

    to tell Cloudinary that you want to upload video. Or,

    uploadParams.put("resource_type", "auto")

    to let Cloudinary determine the file's content.