Upload large files as chunk upload from android SDK
Hi,
I want to upload large video file to cloudinary. I've gone through the documentation and found that iOS supports chunked upload, but I could not see same in the Android SDK.
Currently I am using 'com.cloudinary:cloudinary-android:2.0.0' and I could not find "uploadLarge" method in MediaManager class
MediaManager.get().upload(imageFile.path)
I would like to know how can I upload large files from Android SDK, Also where can I check max file limit in the account settings, and how can we increase it.
Thanks
-
Hi,
There is a `uploadLarge` method for Android which is similar to the Java upload Large. You can see a test sample here: https://github.com/cloudinary/cloudinary_android/blob/52f612044c85256babe5a579d629d95a1d6657b1/lib/src/androidTest/java/com/cloudinary/android/UploaderTest.java#L415
Make sure to pass resource_type=video when testing it on a video.The following code is an example of a way to upload a video in chunks:
public String uploadVideoCloudinary(
@NotNull RecordingUpload recordingUpload,
@NotNull String objectKey
) {
return MediaManager.get().upload(recordingUpload.getRecordFilename())
.policy(new UploadPolicy.Builder()
.maxRetries(5)
.backoffCriteria(60000, UploadPolicy.BackoffPolicy.EXPONENTIAL)
.networkPolicy(UploadPolicy.NetworkType.ANY)
.build())
.option("resource_type", "video")
.option("folder", objectKey)
.option("public_id", String.valueOf(recordingUpload.getId()))
.option("overwrite", true)
.option("connect_timeout", 600000)
.option("chunk_size", 6000000)
.dispatch();
}Hope this helps.
Regards,
Tamara
Post is closed for comments.
Comments
1 comment