Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)
like image 913
Katedral Pillon Avatar asked Sep 30 '15 23:09

Katedral Pillon


1 Answers

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.

like image 106
Tal Lev-Ami Avatar answered Oct 19 '22 14:10

Tal Lev-Ami