How to use upload_chunked_stream correctly?

Olex Member Posts: 2

I'm trying to upload a unity 3D model file. The file size exceeds the maximum file size allowed for the free plan.

But I thought that using the upload_chunked_stream + chunk_size could help me solve this problem. So I did the following:

async uploadChunkedStream(file: any, options: any): Promise<any> {
        return new Promise((resolve, reject) => { 
            const { buffer, originalname } = file;
            const public_id = `Unity3D/${originalname}`;

            const uploadStream = cloudinary.uploader.upload_chunked_stream(
                    resource_type: 'raw',
                    chunk_size: 6000000, // 6MB
                (error: Error, result: UploadApiResponse) => {
                    if (result) {
                    } else {


but it didn’t, response:

        "done": false,
        "bytes": 7944344,
        "kind": "upload",
        "resource_type": "raw",
        "public_id": "Unity3D/model.unity3d"

Can upload_chunked_stream really help me with this problem? Or what am I doing wrong?

Best Answer

  • SreeCloudinary
    SreeCloudinary Member, Cloudinary Staff Posts: 26
    Answer ✓

    Hi Olex,

    Thanks for your response.

    You can find details about chunked upload here:

    In short, say you have a 100MB file and would want to tell our server to upload the file into 5 chunks 20MB * 5. This way network is not overloaded. Typically the chunk upload large is required for any files that are larger than 100 MB.

    Hope this helps, please let me know if you have any further questions.

    Best regards,



  • Wissam
    Wissam Member, Cloudinary Staff Posts: 69

    Hi there,

    From the few upload calls I checked in the log I saw you are getting this error: "FileTooLarge: File size too large. Got 13944344. Maximum is 10485760."

    It is failing because the file size is bigger than the permissible file size for your account.

    This is the error on upload - FileTooLarge: File size too large. Got 14099296. The maximum is 10485760.

    By default, the maximum file size when uploading to Cloudinary is 10MB for our Free plan and 20MB for paid plans.

    For more information:

    Hope this helps, please let me know if you have any further questions.



  • Olex
    Olex Member Posts: 2

    Okay, that makes a bit more sense now. thanks.

    but I still have a question, how does the ```upload_chunked_stream``` function work (I didn't find any info in the documentation)? I found it in the cloudinary source code.

    I would be very grateful if you could tell me what problems it can solve and when it is best to use it.