New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android library: Upload Raw files. #20
Comments
Based on your error stack, it looks like you are using older code. Please refresh your code (version as of writing is 1.2.0), and try again. If you are still experiencing this error, please include the relevant segment of your code together with the error stack. |
Ok, I tried 1.2.0, and while trying to upload a mp4 video file, got this error. java.lang.RuntimeException: Invalid image file at com.cloudinary.android.UploaderStrategy.callApi(UploaderStrategy.java:104) at com.cloudinary.Uploader.callApi(Uploader.java:22) at com.cloudinary.Uploader.upload(Uploader.java:55) Cloudinary cloudinary = new Cloudinary(ObjectUtils.asMap( "cloud_name", "XXXX", "api_key", "XXXX", "api_secret", "XXXX")); File toUpload = new File("path to file.mp4"); uploadResult = cloudinary.uploader().upload(toUpload, options); remoteUrl = uploadResult.get("url").toString(); Also, I get the same error, when I try to upload some random files like mp3, or xls. PDF works though, with this same code, after which I thought I should try with the upload method. With uploadLargeRaw, it works now for videos. But, the returned url doesn't have the file extension. And, also, there is no preview image. Is there a way that I can upload a video, and also get a generated preview of the same, as it is done for PDF files? |
What values did you pass in the options.put("resource_type", "video"); As for the returned url, it doesn't require an extension - it works as is. However if you wish to specify the format, you can add an extension (' To checkout more options, see the Video management documentation. |
@tocker Thanks for you response. This works, after I followed the new announcement on the website, and tried it out. I will close this issue now. |
File file = new File(filePath); System.err: at com.cloudinary.android.UploaderStrategy.callApi(UploaderStrategy.java:50) Image not upload in Android |
@tocker thanks for your answer |
How do I upload a raw file to cloudinary using the android SDK? If I use the upload method, which works for images, it saves the file as an image(for a video).
I tried the uploadLargeRaw method, but getting errors.
The text was updated successfully, but these errors were encountered: