Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Following is an example of the entire multipart object uploading POST process, using CURL (with line breaks for ease of reading). 

Include Page
public:SHARE - cluster in URLpublic:
SHARE - cluster in URL

  1. Start the upload with a 0-byte POST. Set the encoding (&encoding=2:1) if there is no default encoding or you need a non-default setting:

    Code Block
    languagebash
    titleInitiate the upload
    curl -i 
    	"${cluster}/
    	?uploads" 
    	-XPOST


  2. In the response, locate the headers for the UploadID and the Content-UUID, which is the new object being created:

    Code Block
    languagetext
    titleReturned headers
    Castor-System-UploadID: 
    	c88fe8a5daf98f7ce84dc4947238f5c1d0b0b42b8ce464e4566cc2c080ecf401d0b0b42b8ce464e4566cc2c080ecf4010P 
    Content-UUID: 
    	c88fe8a5daf98f7ce84dc4947238f5c1


  3. Write the first part using the UploadID and Content-UUID and partNumber=1:

    Code Block
    languagebash
    titleUpload the first part
    curl -i 
    	"${cluster}/c88fe8a5daf98f7ce84dc4947238f5c1
    	?partNumber=1
    	&uploadid=c88fe8a5daf98f7ce84dc4947238f5c1d0b0b42b8ce464e4566cc2c080ecf401d0b0b42b8ce464e4566cc2c080ecf4010P" 
    	-XPOST 
    	--data-binary 
    	"part 1 data"

    You will use the Content-UUID returned by this post in the manifest to complete the upload.

  4. Start the second part using the UploadID and Content-UUID and partNumber=2:

    Code Block
    languagebash
    titleUpload the second part
    curl -i 
    	"${cluster}/c88fe8a5daf98f7ce84dc4947238f5c1
    	?partNumber=2
    	&uploadid=c88fe8a5daf98f7ce84dc4947238f5c1d0b0b42b8ce464e4566cc2c080ecf401d0b0b42b8ce464e4566cc2c080ecf4010P" 
    	-XPOST 
    	--data-binary 
    	"part 2 data"

    Again, you will use the Content-UUID returned by this post in the manifest to complete the upload.

  5. Complete the upload with the UploadID and a part manifest:

    Info
    titleNote
    Be sure to follow Follow this usage of double quotes.


    Code Block
    languagebash
    titleComplete the upload
    curl -i 
    	"${cluster}/c88fe8a5daf98f7ce84dc4947238f5c1
    	?uploadid=c88fe8a5daf98f7ce84dc4947238f5c1d0b0b42b8ce464e4566cc2c080ecf401d0b0b42b8ce464e4566cc2c080ecf4010P" 
    	-XPOST 
    	--data-binary '{
    	   "parts":[
    	      {
    	         "partNumber":1,
    	         "uuid":"9b149f0959839cee2c915dedfa8d7e25"
    	      },
    	      {
    	         "partNumber":2,
    	         "uuid":"76e7f0c7c417b7bca7daedbe3e18bf40"
    	      }
    	   ]
    	}'


  6. The response code on the complete will indicate success. To verify the completed object, you can HEAD the object:

    Code Block
    languagebash
    titleVerify completed object
    curl --head "${cluster}/c88fe8a5daf98f7ce84dc4947238f5c1"