To access all the latest updates, features & functionality we strongly advise that you use API v2

API v1 Has Been Deprecated

To access all the latest updates, features & functionality we strongly advise that you use API v2

Summary

This API call allows a user to save a file to vzaar's storage space on AWS S3, so that it can then be processed.

The arguments used to submit the upload HTTP POST must be obtained from the sign call.

The sign call includes an expiration time. It is suggest the upload is done immediately after requesting the arguments to keep within this expiration window.

Endpoint

https://{bucket}.s3.amazonaws.com/

Formats

  • XML

Arguments

  • None

Parameters

  • bucket string - The vzaar bucket that has been allocated for this file
  • key string - A name for the S3 object that will store the uploaded file's data
  • AWSAccessKeyId string - The vzaar AWS Access Key Identifier credential
  • acl string-The access control policy to apply to the uploaded file
  • policy - A Base64-encoded policy document that applies rules to file uploads sent by the S3 POST form. This document is used to authorize the form, and to impose conditions on the files that can be uploaded
  • signature string - A signature value that authorizes the form and proves that only vzaar could have created it. This value is calculated by signing the policy document
  • success_action_status integer - The status code returned to the client upon successful upload if success_action_redirect is not specified. This must be set to 201 to match the policy document we create
  • success_action_redirect string - Specifies if to redirect to a URL after a successful post instead of issuing a 201. If set this must be the same as specified in the sign call

Additional Flash Parameters (if submitting by a flash uploader)

  • content-type string - The content type in the post paramter should be 'binary/octet-stream'
  • Filename string - The name of the file passed through from the flash. Flash does this automatically.

HTTP Methods

  • POST

Authentication

  • By S3 policy document

Responses

  <?xml version="1.0" encoding="UTF-8"?>
  <postresponse>
  <location>url</location>
  <bucket>string</bucket>
  <key>string</key>
  <etag>string</etag>
  </postresponse>

Description

For this call the return is from AWS. HTTP error codes will signify succuss or failure as with vzaar direct calls. One can essentially ignore the XML payload with the return. A description of the fields is included here for completeness.

  • Location - The url of where the source file is stored
  • Bucket - The AWS S3 bucked the video has been stored in
  • Key - The AWS S3 object for the file. Can seen essentaill as path and filename.
  • ETag - The entity tag is an MD5 hash of the object.

Examples

Call: uploading a file to aws s3 with an html form

<html>
  <head>
  <title>S3 POST Form</title>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
  </head>

  <body>
	<form enctype="multipart/form-data" method="post" action="https://vzaar_development_bucket.s3.amazonaws.com/">
	<input name="content-type" value="binary/octet-stream" type="hidden" />
	<input name="key" value="vzc/f7a/source/vzcf7af7bc5a734c30a46ca3911e7f3458/${filename}" type="hidden" />
	<input name="AWSAccessKeyId" value="96ZODEDA709P5JNKI6X08U7PBQ31GUY8" type="hidden" />
	<input name="acl" value="private" type="hidden" />
	<input name="policy" value="ewogICAgICAnZ ... JywgIF0KICAgICAgfQ==" type="hidden" />
	<input name="success_action_redirect" value="http://example.com?guid=vzcf7af7bc5a734c30a46ca3911e7f3458" type="hidden" />
	<input name="signature" value="wO30KCBtY8wEYDSSXGa0f5I+Q4Q=" type="hidden" />

  File to upload to S3:
  <input name="file" type="file" />
  <br />
  <input value="Upload File to S3" type="submit" />
  </form>
  </body>
  </html>

Response

HTTP/1.1 301 Moved Permanently
  Date: Fri, 10 Jul 2009 14:06:19 GMT
  Content-Type: text/html; charset=utf-8
  Connection: keep-alive
  Status: 301 Found
  Location: http://example.com?guid=vzcf7af7bc5a734c30a46ca3911e7f3458&bucket=vzaar_development-bucket&key=vzaar%2Fvzc%2Ff7a%2Fsource% vzcf7af7bc5a734c30a46ca3911e7f3458%2Fcapture7.mov&etag=%22400ade980d3f300104916f014baffa52%22
  X-Runtime: 0.92015
  Content-Length: 103
  Cache-Control: no-cache

Call: uploading a file to aws s3 with flash (SWFupload)

<object data="/flash/upload/swfupload.swf?preventswfcaching=1260" class="swfupload" id="SWFUpload_0" type="application/x-shockwave-flash" height="30" width="65">
	<param name="wmode" value="transparent" />
	<param name="movie" value="/flash/upload/swfupload.swf?preventswfcaching=1260" />
	<param name="quality" value="high" />
	<param name="allowScriptAccess" value="always" />
	<param name="flashvars" value="movieName=SWFUpload_0&amp;uploadURL=http%3A%2F%2Fvz1.s3.amazonaws.com%2F&amp;useQueryString=false&amp;requeueOnError=false&amp;httpSuccess=201&amp;assumeSuccessTimeout=0&amp;params=&amp;filePostName=file&amp;fileTypes=*.*&amp;fileTypesDescription=All%20Files&amp;fileSizeLimit=0&amp;fileUploadLimit=10&amp;fileQueueLimit=0&amp;debugEnabled=false&amp;buttonImageURL=&amp;buttonWidth=65&amp;buttonHeight=29&amp;buttonText=%3Cspan%20class%3D%22theFont%22%3EBrowse%3C%2Fspan%3E&amp;buttonTextTopPadding=3&amp;buttonTextLeftPadding=6&amp;buttonTextStyle=.theFont%20%7B%20font-size%3A%2016%3B%20%7D&amp;buttonAction=-110&amp;buttonDisabled=false&amp;buttonCursor=-2" />
  </object>

Response

HTTP/1.1 201 Created
  x-amz-id-2: pA5rRnF0dVdRs0pmLHMUwtA2YAMkYXF9cgUfAqG+A782KQGMr2zlYoLgUm7fozq1
  x-amz-request-id: 509791B914571627
  Date: Tue, 16 Feb 2010 14:20:05 GMT
  ETag: "5b58fd4cc358a7bd05e84ac93d724ad2"
  Location: http://vz1.s3.amazonaws.com/vzaar%2Fvzf%2F5d6%2Fsource%2Fvzf5d6fa095fd24d918f8b92ab759a66c3%2FCapture29.mov
  Content-Type: application/xml
  Content-Length: 357
  Server: AmazonS3
  Connection: close

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

	<postresponse>
	<location>http://vz1.s3.amazonaws.com/vzaar%2Fvzf%2F5d6%2Fsource%2Fvzf5d6fa095fd24d918f8b92ab759a66c3%2FiShowU-Capture29.mov</location>
	<bucket>vz1</bucket>
	<key>vzaar/vzf/5d6/source/vzf5d6fa095fd24d918f8b92ab759a66c3/Capture29.mov</key>
	<etag>"5b58fd4cc358a7bd05e84ac93d724ad2"</etag>
  </postresponse>

contact us   by phone, mail or twitter...
libraries
ruby java php .net node
affiliates
affiliate program


Powered by Olark