This support forum is no longer in use. Please use the Cloudinary Community at https://community.cloudinary.com/ to receive assistance from other members of the community and from Cloudinary's support team. For account-specific questions or if you believe that you've encountered a bug, please contact the Cloudinary team directly via the "submit a request" option on this support site.

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

Post is closed for comments.