Upload API
SHARE-ONLINE.biz UPLOAD APITo upload files with your own upload-tools or from your own website, use the following documantion to get all required information how to use it. All data has to be sent as POST-HTTP-data to port 80 of every given server/URL. The upload is divided into two parts: Create the upload session:The response always includes the created sessionname and the upload URL divided by ";".
Request to: http://www.share-online.biz/upv3_session.php
Required Vars:
[username] account username
[password] account password
Response: SESSIONNAME;UPLOADSERVER/SKRIPT.PHP
Example: GW63P9DEC;http://server/upv3.php
Upload the data:Getting the session is really easy, uploading without any chunk-usage, too. So we start with the single file upload ;-): Single Upload:
Request to: http://server/upv3.php
Required Vars:
[username] account username
[password] account password
[upload_session] upload session name from step 1
[chunk_no] set to "1"
[chunk_number] set to "1"
[filesize] filesize of current file in bytes
[fn] filedata (in HTTP forms known as type="file")
[finalize] set to "1"
Response: DOWNLOAD-URL;FILESIZE;MD5
Example: http://www.share-online.biz/dl/HJD74ZDM1;
6547231;316508123e89909723fe95945caf00a5
(linebreak only in example!)
Chunk Upload:This upload type is ideal for uploader tools with resume function and progress output.
Request to: http://server/upv3.php
1. Required Vars ((re)uploading chunks):
[username] account username
[password] account password
[upload_session] upload session name from step 1
[chunk_no] the current chunk number (start with "1")
[chunk_number] the overall count for all calculated chunks
(never change this during upload - max 8191)
[filesize] filesize of current file in bytes (overall, not chunk!)
[fn] filedata (of current chunk)
Response: MD5
Example: 316508123e89909723fe95945caf00a5
---------------------------------------------------------------------
2. Required Vars (finish the upload):
[username] account username
[password] account password
[upload_session] upload session name from step 1
[chunk_no] the current LAST chunk number
[chunk_number] the overall count for all calculated chunks equals [chunk_no]
[filesize] filesize of the resulting file (all chunks)
[finalize] set to "1"
Response: DOWNLOAD-URL;FILESIZE;MD5
Example: http://www.share-online.biz/dl/HJD74ZDM1;
6547231;316508123e89909723fe95945caf00a5
(linebreak only in example!)
Annotation:At least a small html-form with all required post-fields for single/chunk upload:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>UPLOAD-API</title>
</head>
<body>
<form enctype="multipart/form-data" action="http://server/upv3.php" method="POST">
<table>
<tr><td>Uploadfile:</td><td><input name="fn" type="file" />
<input type="submit" value="Upload File" /></td></tr>
<tr><td>Session:</td><td><input type="text" name="upload_session" value="" /></td></tr>
<tr><td>Chunk_no:</td><td><input type="text" name="chunk_no" value="" /></td></tr>
<tr><td>Chunk_number:</td><td><input type="text" name="chunk_number" value="" /></td></tr>
<tr><td>Filesize:</td><td><input type="text" name="filesize" value="" /></td></tr>
<tr><td>Finalize:</td><td><input type="text" name="finalize" value="" /></td></tr>
<tr><td>Username</td><td><input type="text" name="username" value="" /></td></tr>
<tr><td>Password</td><td><input type="text" name="password" value="" /></td></tr>
<tr><td><input type="submit" value="Upload File" /></td></tr>
</table>
</form>
</body>
</html>
Feel free to contact our support with any kind of question of suggestion. |



