Invalid cloud image file exception

Cloudinary has just an example of how to upload images from android to the cloud. However, I need to upload the video. When I use the call from the sample code, I get an error Invalid image file. Here is the call that throws an exception

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

Does anyone know a call to download 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)
+4
source share
1 answer

You must add

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

to tell Cloudinary that you want to download the video. Or,

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

so that CloudMan determines the contents of the file.

+6
source

Source: https://habr.com/ru/post/1609716/


All Articles