Upload File

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

This API uploads a file to a destined team folder or folder in WorkDrive.

Note:

  • This API will only upload files of size up to 250MB. To upload files more than 250MB, use Upload Large File API.

  • We recommend using Chunk File Upload API for files greater than 1 GB in size.

  • We have code samples for this API in multiple programming languages.See code samples

  • Only admins, organizers, and editors can upload files in a team folder.

Based on the status code in response, you can monitor the upload status of files.
Upload Status codes:
  • 200 - Returns File Meta in response.
  • 400 - Content parameter is missing.
  • 401 - Invalid user's credentials/ Parent folder not belong to the user.
  • 402 - WorkDrive license is in a suspended state.
  • 409 - Same file name already in this Parent folder. File will not be uploaded.
  • 413 - File size is greater than 250 MB.
  • 500 - An Unknown error occurred
  • 507 - User organization storage is full.
  • 509 - User's MyFolders storage is full.
Endpoints

OAuth Scope

WorkDrive.files.CREATECopied!

Request Example

cURL
cURL
Deluge
Copied!
curl --request POST \
  --url https://www.zohoapis.com/workdrive/api/v1/upload \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: multipart/form-data' \
  -F 'parent_id=string' \
  -F 'content=@file_path'

Request Body

multipart/form-data
filenamestring(Optional)

The file name must be URL-encoded in UTF-8 format and should include the appropriate file extension.

parent_idstring(Required)

The unique ID of folder where files to be uploaded.
To upload a file inside your My Folders, use myfolder_id fetched using step 3 given here as the parent_id.

override-name-existstring(Optional)

If set as "true", a file with the matching name will be uploaded as a top version over the existing file.
If set as "false", a file with the matching name will have the timestamp added to it on upload.

contentbinary(Required)

The multi-part file to be uploaded and the maximum file size is 250 MB.

Body Parameters

Copied!
// Note: payload contains multiple type attributes

// type: string
filename = string

// type: string
parent_id = string

// type: string
override-name-exist = string

// type: file
content = <file>
Show full

Response Example

200
Copied!
  {
    "initParameterNames": {},
    "servletContext": {
      "initParameterNames": {},
      "virtualServerName": "string",
      "classLoader": {
        "parent": {},
        "unnamedModule": {
          "declaredAnnotations": [
            {}
          ],
          "named": true,
          "classLoader": {},
          "name": "string",
          "annotations": [
            {}
          ],
          "descriptor": {
            "automatic": true,
            "open": true
          },
          "packages": [
            "string"
          ],
          "layer": {}
        },
        "name": "string",
        "registeredAsParallelCapable": true,
        "definedPackages": [
          {
            "specificationVendor": "string",
            "declaredAnnotations": [
              null
            ],
            "specificationTitle": "string",
            "implementationVersion": "string",
            "sealed": true,
            "name": "string",
            "implementationVendor": "string",
            "annotations": [
              null
            ],
            "implementationTitle": "string",
            "specificationVersion": "string"
          }
        ]
      },
      "filterRegistrations": {
        "property1": {
          "initParameters": {
            "property1": "string",
            "property2": "string"
          },
          "name": "string",
          "className": "string",
          "servletNameMappings": [
            "string"
          ],
          "urlPatternMappings": [
            "string"
          ]
        },
        "property2": {
          "initParameters": {
            "property1": "string",
            "property2": "string"
          },
          "name": "string",
          "className": "string",
          "servletNameMappings": [
            "string"
          ],
          "urlPatternMappings": [
            "string"
          ]
        }
      },
      "servletNames": {},
      "contextPath": "string",
      "defaultSessionTrackingModes": [
        "COOKIE"
      ],
      "majorVersion": 0,
      "sessionCookieConfig": {
        "path": "string",
        "maxAge": 0,
        "domain": "string",
        "name": "string",
        "comment": "string",
        "httpOnly": true,
        "secure": true
      },
      "effectiveMinorVersion": 0,
      "effectiveSessionTrackingModes": [
        "COOKIE"
      ],
      "attributeNames": {},
      "servletRegistrations": {
        "property1": {
          "initParameters": {
            "property1": "string",
            "property2": "string"
          },
          "mappings": [
            "string"
          ],
          "runAsRole": "string",
          "name": "string",
          "className": "string"
        },
        "property2": {
          "initParameters": {
            "property1": "string",
            "property2": "string"
          },
          "mappings": [
            "string"
          ],
          "runAsRole": "string",
          "name": "string",
          "className": "string"
        }
      },
      "serverInfo": "string",
      "jspConfigDescriptor": {
        "jspPropertyGroups": [
          {
            "elIgnored": "string",
            "isXml": "string",
            "errorOnUndeclaredNamespace": "string",
            "trimDirectiveWhitespaces": "string",
            "scriptingInvalid": "string",
            "urlPatterns": [
              null
            ],
            "pageEncoding": "string",
            "includePreludes": [
              null
            ],
            "buffer": "string",
            "deferredSyntaxAllowedAsLiteral": "string",
            "defaultContentType": "string",
            "includeCodas": [
              null
            ]
          }
        ],
        "taglibs": [
          {
            "taglibLocation": "string",
            "taglibURI": "string"
          }
        ]
      },
      "servlets": {},
      "requestCharacterEncoding": "string",
      "responseCharacterEncoding": "string",
      "sessionTimeout": 0,
      "minorVersion": 0,
      "servletContextName": "string",
      "effectiveMajorVersion": 0
    },
    "servletConfig": {
      "initParameterNames": {},
      "servletContext": {
        "initParameterNames": {},
        "virtualServerName": "string",
        "classLoader": {
          "parent": {},
          "unnamedModule": {
            "declaredAnnotations": [
              null
            ],
            "named": true,
            "classLoader": {},
            "name": "string",
            "annotations": [
              null
            ],
            "descriptor": {},
            "packages": [
              null
            ],
            "layer": {}
          },
          "name": "string",
          "registeredAsParallelCapable": true,
          "definedPackages": [
            {
              "declaredAnnotations": [],
              "annotations": []
            }
          ]
        },
        "filterRegistrations": {
          "property1": {
            "initParameters": {},
            "name": "string",
            "className": "string",
            "servletNameMappings": [
              null
            ],
            "urlPatternMappings": [
              null
            ]
          },
          "property2": {
            "initParameters": {},
            "name": "string",
            "className": "string",
            "servletNameMappings": [
              null
            ],
            "urlPatternMappings": [
              null
            ]
          }
        },
        "servletNames": {},
        "contextPath": "string",
        "defaultSessionTrackingModes": [
          "COOKIE"
        ],
        "majorVersion": 0,
        "sessionCookieConfig": {
          "path": "string",
          "maxAge": 0,
          "domain": "string",
          "name": "string",
          "comment": "string",
          "httpOnly": true,
          "secure": true
        },
        "effectiveMinorVersion": 0,
        "effectiveSessionTrackingModes": [
          "COOKIE"
        ],
        "attributeNames": {},
        "servletRegistrations": {
          "property1": {
            "initParameters": {},
            "mappings": [
              null
            ],
            "runAsRole": "string",
            "name": "string",
            "className": "string"
          },
          "property2": {
            "initParameters": {},
            "mappings": [
              null
            ],
            "runAsRole": "string",
            "name": "string",
            "className": "string"
          }
        },
        "serverInfo": "string",
        "jspConfigDescriptor": {
          "jspPropertyGroups": [
            {
              "urlPatterns": [],
              "includePreludes": [],
              "includeCodas": []
            }
          ],
          "taglibs": [
            {}
          ]
        },
        "servlets": {},
        "requestCharacterEncoding": "string",
        "responseCharacterEncoding": "string",
        "sessionTimeout": 0,
        "minorVersion": 0,
        "servletContextName": "string",
        "effectiveMajorVersion": 0
      },
      "servletName": "string"
    },
    "servletInfo": "string",
    "servletName": "string"
  }
                
Show full