Previous page

Next page

Locate page in Contents

Print this page

download

Summary:

Downloads a file from a server. The call is also capable of extracting files from a backup archive.

Request specification:

Name

Min/Max

Type

Description

download

 

 

 

{

 

 

 

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 download.

{

 

 

 

path

1..1

base64Binary

The source path and file name.

size

0..1

long

Size of the data block to be transferred.

offset

0..1

long

Offset in the source file.

}

 

 

 

}

 

 

 

Returns:

Name

Min/Max

Type

Description

file

 

 

 

{

 

 

 

body

0..1

base64Binary

The file data.

}

 

 

 

Description:

The call reads the data from the specified source file and transfers the data to the client in blocks of the specified size. It does not automatically create a file on the target machine, so it is your responsibility to process the received data.

To extract a file from a backup archive, the <cwd> element must contain a URI specifying the backup ID. The format of the URI is as follows:

backup://backup_id

where backup_id is the ID of the backup archive, and the <path> element must contain an absolute path to the original location of a file or directory. For example:

<cwd>backup://a28d77df-a4e1-4d98-a01c-dc85b6d19f7b/20060718064512</cwd>

<path>C:/Windows/info.txt</path>

Example:

Downloading a file from a server in two sequential transfers.

Input

Reading the first block of data.

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

<target>filer</target>

<data>

<filer>

<download>

<file>

<path>dGVzdDAxLnR4dA==</path>

<size>12</size>

</file>

</download>

</filer>

</data>

</packet>

Output

The body element contains the data.

<ns1:packet version="4.0.0">

<ns1:origin>filer</ns1:origin>

<ns1:target>vzclient3</ns1:target>

<ns1:dst>

<ns1:director>gend</ns1:director>

</ns1:dst>

<ns1:data>

<ns2:filer>

<ns2:file>

<ns2:body>RGF0YSBibG9jayAx</ns2:body>

</ns2:file>

</ns2:filer>

</ns1:data>

<ns1:src>

<ns1:director>gend</ns1:director>

</ns1:src>

</ns1:packet>

Input

Reading the second block of data. The offset element marks the beginning of the block in the source file.

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

<target>filer</target>

<data>

<filer>

<download>

<file>

<path>dGVzdDAxLnR4dA==</path>

<size>17</size>

<offset>12</offset>

</file>

</download>

</filer>

</data>

</packet>

Output

The body element contains the data.

<ns1:packet version="4.0.0">

<ns1:origin>filer</ns1:origin>

<ns1:target>vzclient3</ns1:target>

<ns1:data>

<ns2:filer>

<ns2:file>

<ns2:body>U2Vjb25kIGRhdGEgYmxvY2s=</ns2:body>

</ns2:file>

</ns2:filer>

</ns1:data>

</ns1:packet>

Please send us your feedback on this help page