How to: Upload a work by chunks: Difference between revisions

From Safe Creative API
Jump to navigation Jump to search
(779)
w>Jguillo
m (Reverted edits by 195.77.234.2 (Talk) to last revision by 202.93.213.34)
Line 29: Line 29:
</pre>
</pre>


m8qyBS  <a href="http://ojiztbqpnlxg.com/">ojiztbqpnlxg</a>, [url=http://akvfgurlzqfy.com/]akvfgurlzqfy[/url], [link=http://jgtxbeizadro.com/]jgtxbeizadro[/link], http://hajvkjpbpbli.com/
= Upload file chunks =
 
You can upload the file by chunks with [[work.upload.chunk]]. You send the uploadid the offset and the data encoded in base64.
 
You can retry sending any chunk when it fails, you can send a chunk more than once and the send order of the chunks is not relevant
 
REQUEST:
 
<pre>
https://upload01.safecreative.org/v2/
?authkey=1i5g2aaf2bz09lyo867cuimqg
&component=work.upload.chunk
&data=VmVyeSBsb25nIGZpbGU%3D
&offset=0
&uploadid=32fdc258-d822-43f1-9192-22fbb33c133a
&ztime=1271749853485
&signature=3db8efc39d5fa86ff438a638b83585377e136cb7
</pre>
 
RESPONSE:
 
<?xml version="1.0" encoding="UTF-8"?>
<workuploadchunk>
  <state>continue</state>
</workuploadchunk>


= Finishing the upload =
= Finishing the upload =

Revision as of 06:32, 31 May 2010

File upload process

You can upload a work using the components work.upload.lookup, work.upload.begin, work.upload.chunk and work.upload.commit or using a standard HTTP POST upload through an upload servlet.

We encourage to use the POST upload, but in case of very large files or unreliable connections, the chunk upload described below may be better.

Xy3b5a <a href="http://hnjcsoijdvoq.com/">hnjcsoijdvoq</a>, [url=http://txkcvabbzkrx.com/]txkcvabbzkrx[/url], [link=http://bgdoedvimhia.com/]bgdoedvimhia[/link], http://maycrxeahshu.com/

Starting the upload process

Call work.upload.begin to initiate the upload process

REQUEST:

https://upload01.safecreative.org/v2/
?authkey=1i5g2aaf2bz09lyo867cuimqg
&component=work.upload.begin
&uploadid=32fdc258-d822-43f1-9192-22fbb33c133a
&ztime=1271749853224
&signature=169c8e1d4348578ff07188c3040eb596fe5455ab

RESPONSE:

<?xml version="1.0" encoding="UTF-8"?>
<restvalueresponse>
  <state>ready</state>
</restvalueresponse>

Upload file chunks

You can upload the file by chunks with work.upload.chunk. You send the uploadid the offset and the data encoded in base64.

You can retry sending any chunk when it fails, you can send a chunk more than once and the send order of the chunks is not relevant

REQUEST:

https://upload01.safecreative.org/v2/
?authkey=1i5g2aaf2bz09lyo867cuimqg
&component=work.upload.chunk
&data=VmVyeSBsb25nIGZpbGU%3D
&offset=0
&uploadid=32fdc258-d822-43f1-9192-22fbb33c133a
&ztime=1271749853485
&signature=3db8efc39d5fa86ff438a638b83585377e136cb7

RESPONSE:

<?xml version="1.0" encoding="UTF-8"?> <workuploadchunk>

 <state>continue</state>

</workuploadchunk>

Finishing the upload

Once you have uploaded all chunks, you can commit the uploaded file using work.uplod.commit.

You must send the SHA1 checksum of the uploaded file for validation.

This component will return an upload ticket to be used later for registering the work.

REQUEST:

https://upload01.safecreative.org/v2/
?authkey=1i5g2aaf2bz09lyo867cuimqg
&checksum=9f9e051a32f6a773335a0cc1d4cf94d17b49faa6
&component=work.upload.commit
&length=14
&uploadid=32fdc258-d822-43f1-9192-22fbb33c133a
&ztime=1271749853854
&signature=9d9f8b51e73fec2364f9c08af7d5e526086dbd17

RESPONSE:

<?xml version="1.0" encoding="UTF-8"?>
<workuploadcommit>
  <uploadticket>HvWIbGj7anBOe9jBEyThJriUBVty_zu-dOyhOh--YmXAtfGZCEGRvZqs3HyW5_ZkpU7ZPfFYOhhqjNpON-EqT7mLzLL5IMHbbYrUdGztRd0KetgtOsZW_qZqR_Xnv68zn012s1ORd8izn-HK4HInC9uidLqj68kRjDNH28UkyC_HCLG5VfLktWGqm2zigYOhympUDUY4ZUJuFNKBqQhsFbpaTMQQvV5eB9HF2DauB3LmFCdxEYOZDg==</uploadticket>
</workuploadcommit>


w0CKPT <a href="http://juhxisnpkjvh.com/">juhxisnpkjvh</a>, [url=http://kdzgvjejtivk.com/]kdzgvjejtivk[/url], [link=http://bmntvllyypqy.com/]bmntvllyypqy[/link], http://lcbplfbsoiqi.com/