You typically need ranged PUT requests for very large uploads, especially when network bandwidth or latency might cause the operation to time out.

If the response to an upload progress request indicates that the upload terminated before it was complete, you can use the size and bytesTransferred values from the response to construct a ranged PUT request of the remaining contents, as shown in Ranged PUT Request to Complete a Partial Upload.

Procedure

  1. Retrieve the VAppTemplate and find the File element that references the partially uploaded file.
  2. Make a PUT request that specifies a Content-Range and Content-Length and includes the serialized contents of the range.
    For the bytes attribute of the Content-Range, specify the value of the File element's bytesTransferred attribute for the low end of the range and the value of its size attribute for the high end of the range. For Content-Length, subtract the value of the File element's bytesTransferred attribute from the value of its size attribute.

Example: Ranged PUT Request to Complete a Partial Upload

The following request completes the upload of the file disk0.vmdk shown in this fragment of a VAppTemplate.

<VAppTemplate
   ... >
   ...
   <Files>
      ...
      <File
         size="1950489088"
         bytesTransferred="500000000"
         name="disk0.vmdk">
         ...
      </File>
   </Files>
   ...
</VAppTemplate>
Request:
PUT https://vcloud.example.com/transfer/.../disk0.vmdk
Content-Range: bytes 500000000-1950489087/1950489088
Content-Length: 1450489088
   ...serialized contents of specified range...
EOF
Response:
200 OK