Previous page

Next page

Locate page in Contents

Print this page

upload

Summary:

Uploads a file to a server.

Request specification:

Name

Min/Max

Type

Description

upload

 

 

 

{

 

 

 

cwd

0..1

base64Binary

Current working directory. The default value is:

Linux "/"

Windows"C:\"

cred

0..1

credType

Credentials with which the requested operation will be performed.

file

1..[]

 

Files to upload. One packet may contain multiple file elements so you can transfer more than one block of data in one call.

{

 

 

 

path

1..1

base64Binary

Target path and file name.

size

1..1

long

The size of the data block being transferred in bytes.

offset

0..1

long

Offset in the target file in bytes.

If not supplied, then the data will be inserted at the beginning of the file.

If set to -1, then the data will be appended at the end of the file.

The force element (below) must be always included when working with existing files.

body

0..1

base64Binary

The block of data to be transferred.

}

 

 

 

mode

0..1

mode_type

Linux Access permissions for the new file in decimal form. The mode is affected by umask.

force

0..1

none

Include this element if the destination file already exists and you want to overwrite it or add more data to it using the offset option.

If the element is absent and the file already exists on the destination machine, the call will fail.

}

 

 

 

Returns:

OK/Error

Example:

Input

Uploading the first block of data. The file doesn't exist on the target machine yet, so it will be created.

<packet version="4.0.0" id="545">

<target>filer</target>

<data>

<filer>

<upload>

<file>

<path>dGVzdDAxLnR4dA==</path>

<size>12</size>

<body>RGF0YSBibG9jayAx</body>

</file>

</upload>

</filer>

</data>

</packet>

Uploading the second data block. To append the data to the end of the file, the offset and the force options must be used.

<packet version="4.0.0" id="545">

<target>filer</target>

<data>

<filer>

<upload>

<file>

<path>dGVzdDAxLnR4dA==</path>

<size>17</size>

<body>U2Vjb25kIGRhdGEgYmxvY2s=</body>

<offset>12</offset>

</file>

<force/>

</upload>

</filer>

</data>

</packet>

Please send us your feedback on this help page