Upload large files as chunk upload from android SDK

Comments

1 comment

  • Avatar
    Tamara Yulevich

    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

    0
    Comment actions Permalink

Please sign in to leave a comment.