Upload a File to an ObjectStore Public Share (REST API: POST)


This operation uploads a single file to a public shared folder in Edge Drive. The API is used for uploading files that are relatively small in size. You can also verify the file integrity using Secure Hash Algorithm (SHA) - 256 cryptographic hash function. For more information, see File Integrity Check.

For larger files (greater than 4 MB), upload the files in multiple data chunks. For more information, see Upload a File in Chunks.



POST <webservice>/drive/publicshare/{shareId}/file/action/upload?uploadType=fullFile HTTP/1.1

Host: <host name>

Accept: application/xml

ExternalFileGUID: <GUID from an external source>

FileName: <file name in base64 format>

FileSize: <file size in bytes>

FileModifiedtime: <modified time in UNIX timestamp>

ParentFolderPath: <file path in base64 format>

FullFileHash: <SHA hash of the file>

<file contents>

where <webservice> is the root path used to route the API requests to the Web Server.

For more information, see Available Web Services for REST API.

Request Parameters





The unique identifier (syncWebFolderId response) returned when you share a file or folder or view the shared files and folders in Edge Drive. For details on retrieving the syncWebFolderId response, see Sharing a File or Folder or Viewing Shared Files and Folders.


Request Headers




The host name of the Web Server or Web Console used in the API request.


The format of the response. Valid values are: application/xml or application/json.


(optional) If you have a 128-bit globally unique identifier (GUID) outside of the Commvault software, you can add it as a header so that it is assigned as the fileGUID for the file you are uploading.

If you send a GUID that includes hyphens, the hyphens are removed. Any request or search that uses your GUID must not include the hyphens.


Name of the file to be uploaded. The name must be base64 encoded.


Size (in bytes) of the file to uploaded.


The last modified time of the file to be uploaded. Provide the value in UNIX timestamp format (in seconds). For example, 1424813723.


The path to the destination folder where the file will be uploaded. The path must be relative from the root path and base64 encoded.


Specifies whether to display a preview of the file after the upload. Valid values are 0 and 1.

To skip the file preview, enter the value 1.

If you want to display the file preview, you can skip this header or enter the value 0.


(optional) The SHA hash of the complete file. Use SHA 256 to compute the hash value.

Request Body

Include the entire file contents. Do not include the content-type header.


Response Parameters





The number of bytes received by the Web Server for the uploaded file.



The GUID of the uploaded file.


fileIntegrityVerified (optional)

Value 1 indicates that the hash value is identical and the file integrity check is verified.



The possible error codes.

Valid values are:

  • 200, successful completion.

  • a specific error code.



Sample Request

This sample request uploads a file and displays a preview of the file after the upload.

POST <webservice>/drive/publicshare/37/file/action/upload?uploadType=fullFile HTTP/1.1

Host: client.mydomain.com

Accept: application/xml

FileName: Zmxvd2Vycy50eHQ=

FileSize: 845,941

FileModifiedtime: 1424813723

ParentFolderPath: XHBsYW50cw0K

SkipPreview: 1

FullFileHash: f666c37a95e2f0ce1a9318130a16f3709879832136310b6a7ca07b75ae594e3c

<file contents>

Supported Error Codes





Bad Request

The request is missing required headers or file content in the request body.

Make sure the parameter values and format in the header request are correct. For example, the header request for file modified time must be specified in UNIX timestamp format (in seconds). Specifying a millisecond value will return an error. Also, the name must be base64 encoded.



Error due to one of the following reasons:

  • The user does not have rights to upload the file.

  • The upload operation is disabled by the administrator by disabling backup activity from the CommCell Console.

  • File Integrity check failed. The hash value in the header did not match with the hash value of the uploaded file.



An upload operation is already in progress for the same file. The response body will have the existing requestId and the number of bytes that the web server has already received for the file. Example:

<DM2ContentIndexing_UploadFileResp requestId="13213022088234198160108125214183230586134182" chunkOffset="780830" errorCode="409" />

When a conflict occurs, do the following:

  • Use the same requestID to resume a chunk file upload from the byte offset sent from the server by sending data chunks.

  • Use the following URL parameter to force restart the upload of the file from the beginning. If this approach is used a new upload request session will be initiated and response will have the requestID.  Using the new requestID, the file data can be sent from beginning.



Request Entity Too Large

Upload attempted for a large file (greater than 4MB). For large files, upload the files in multiple data chunks.  For more information, see Upload a File in Chunks.