{"_id":"59df01d71d390500107e1041","project":"54343170fa5527080064f449","version":{"_id":"54343531bfaa3d0800c4d4af","project":"54343170fa5527080064f449","__v":28,"forked_from":"54343170fa5527080064f44c","createdAt":"2014-10-07T18:47:13.086Z","releaseDate":"2014-10-07T18:47:13.086Z","categories":["54343531bfaa3d0800c4d4b0","543435b1edce040800409240","543435b9edce040800409241","543435bcedce040800409243","543435bfedce040800409244","543435c2edce040800409245","54370cc426469424002a6dfa","54370cf026469424002a6dfd","5437129d26469424002a6e2f","543712d226469424002a6e30","5480c8fd74904f1a00053c86","54aafc6eefb39016009e4d71","54ac1d36de18cc1400226e01","54ad59369219922100751732","54b41bcf4f25cb1600518d2c","54b533a3a806f40c0050d53c","54b54bbf96fe3c0b00d38d2a","54b688a27379a90c00f53a8a","54b699efbc1a46160005edfa","54b8191691011f0b00068804","54bfb002d03bfc0d0000e814","54bfb33ed03bfc0d0000e816","55a3e94e912a6e2300882cdb","55a56c370f354f0d00fd02a8","55e85ad034516037002e9325","5638ecb62fc5520d001a4cf9","572cba2fc310640e008f63d5","596e6e42c5b53b00509791b1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3.0"},"category":{"_id":"543435b1edce040800409240","project":"54343170fa5527080064f449","version":"54343531bfaa3d0800c4d4af","__v":17,"pages":["5434906a5b10711400c6c45b","543492315b10711400c6c474","5480a347a3e4ea22000976c4","5480a36ea3e4ea22000976c5","5480a568e952bb1a006b31fb","54ae8b0686f2690b0072b76f","54aeac7b86f2690b0072b7ac","54aeae133697fc1600d894e3","54aed028194a5f1f00a1d172","54aed212194a5f1f00a1d176","54aedfb4194a5f1f00a1d199","54aee0eb194a5f1f00a1d19e","54aee1aa194a5f1f00a1d1a3","54bd5f54c264d50c00d9ef7e","54bd5f5aa0d4080c005f5449","54bd6b1fc264d50c00d9ef8e","559a9069155eef1700f4e68a"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-07T18:49:21.998Z","from_sync":false,"order":2,"slug":"assets","title":"Assets"},"user":"599b4786eac604000fedaf43","__v":142,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-10-12T05:47:03.731Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"post","examples":{"codes":[{"code":"POST /v3/assets/multipart/upload\n{\n    \"fileName\": \"FILE0013.MP4\"\n}","language":"json"},{"code":"POST /v3/assets/multipart/upload\n{\n    \"fileName\": \"FILE0013.MP4\",\n    \"sessionId\": \"9604fc27-77e9-4f95-bf52-b0724b5b440b\"\n}","language":"json"}]},"settings":"","results":{"codes":[{"status":200,"language":"json","code":"{\n    \"fileName\": \"FILE0013.MP4\",\n    \"assetUrl\": \"https://s3.amazonaws.com/s3-bucket/9XXXXXX-7XX9-4XX5-bXX2-b07XXXXXX40b/FILE0013.MP4\",\n    \"expiration\": 1507790546000,\n    \"accessKey\": \"ASIAJCPLGOLJYYTKUXRQ\",\n    \"secretKey\": \"TWfwinpU3YRUXzIN/UoSCqsoobOYKBAIpWMC4Si3\",\n    \"sessionId\": \"9XXXXXX-7XX9-4XX5-bXX2-b07XXXXXX40b\",\n    \"sessionToken\": \"FQoDYXdzEOf//////////wEaDDwBJ3jkRXXXXXXXXXXXXXXXXXXXXXXXvu8hRdXhhb9KEV3VUTiKxHJGmgkT3nd2FbNRJrWYLVG7acZk+Qr4XXXXXXXXXXXXXXXXXXXXG2g6K2tlh/QgMBGLBQ+/nMli2cKuh/CKGSZ3KibspxO+0t35v5rXXXXXXXXXXXXXXXXXXXXXXpYyhih7u1Q8iRSxmtjMf9uRg7RIZa8usnPRZhuAIU9Kc7Y+pJ8gIjTRZQdx5bdaU6hPJQXXXXXXXXXXXXXXXR9XK8Io4m49KzeXV6vKgAd9OV77f0kUc3mOVK2PMrzvOWCTykAjvYeC9XXXXXXXXXXXXXXXXXdEvuiDPZoMAPZ8cXRy3ts5WEr8eVBIaEj+nEtFQrAww3NCytRSXXXXXXXXXX208pDwsVNSMeKMKB/M4F\",\n    \"objectKey\": \"9XXXXXX-7XX9-4XX5-bXX2-b07XXXXXX40b/FILE0013.MP4\",\n    \"bucketName\": \"s3-bucket\"\n}","name":""}]},"auth":"required","params":[{"_id":"54bd6b1fc264d50c00d9ef91","ref":"","in":"body","required":true,"desc":"Name of the file to be stored.","default":"","type":"string","name":"fileName"},{"_id":"59df01d71d390500107e1042","ref":"","in":"body","required":false,"desc":"The session id refers to the upload session in which the file is being uploaded","default":"","type":"string","name":"sessionId"}],"url":"/assets/multipart/upload"},"isReference":false,"order":15,"body":"Requesting a multipartUploadTicket returns all information necessary to perform a file upload directly to S3. \n\nFiles uploaded using this process do not have a limited file size.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"fileName\",\n    \"0-1\": \"This is the file name as it will be stored in S3. It does not have to be the actual name of the local file.\",\n    \"1-0\": \"sessionId\",\n    \"1-1\": \"A session id is passed in to refresh already existing, unexpired temporary credentials. Temporary credentials expire after 1 hour. To complete an upload that takes longer than 1 hour, temporary credentials must be refreshed. Passing in the sessionId lets the refreshed credentials have access to the current upload session to continue uploading the file.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Overview of Multipart Upload\"\n}\n[/block]\nStep 1: Create a multipart upload ticket. This will have all the information needed to upload the asset to S3. This includes fileName, sessionId, assetUrl, expiration, accessKey, secretKey, sessionToken, objectKey(path in S3 where the file is stored), and bucketName.\n\nRefreshing Temporary Credentials: (Temp Creds expire after 1 hour from the time they were created.)\nWhen requesting temporary credentials, you pass in the file name. When you start uploading the file to S3, the sessionId is the reference to that upload session. To refresh temporary credentials, we pass the file name and the sessionId. This way, the refreshed credentials have access to that specific upload session. Then the credentials are interchangeable since they have the same access.\nThere is a code example on refreshing credentials using the Mediasilo API further down this page.\n\nStep 2: Upload the asset to S3. Once the upload is complete, the assetUrl will be accessible to create the asset in your Mediasilo account. NOTE** Although the assetUrl is returned in the multipart upload ticket, the assetUrl is not accessible until the upload is complete.\n\nStep 3: Create the asset. Using the assetUrl and projectId, create the asset inside the desired project. Note** the projectId is the id of an EXISTING project inside of your Mediasilo account.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 1: Create the Multipart Upload Ticket\"\n}\n[/block]\nLet's assume we sent the following request to obtain an multipart upload ticket:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /v3/assets/multipart/upload\\n{\\n    \\\"fileName\\\": \\\"FILE0013.MP4\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nAnd we receive the following payload in response:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"//200 OK\\n{\\n    \\\"fileName\\\": \\\"FILE0013.MP4\\\",\\n    \\\"assetUrl\\\": \\\"https://s3.amazonaws.com/s3-bucket/9XXXXXX-7XX9-4XX5-bXX2-b07XXXXXX40b/FILE0013.MP4\\\",\\n    \\\"expiration\\\": 1507790546000,\\n    \\\"accessKey\\\": \\\"ASIAJCPLGOLJYYTKUXRQ\\\",\\n    \\\"secretKey\\\": \\\"TWfwinpU3YRUXzIN/UoSCqsoobOYKBAIpWMC4Si3\\\",\\n    \\\"sessionId\\\": \\\"9XXXXXX-7XX9-4XX5-bXX2-b07XXXXXX40b\\\",\\n    \\\"sessionToken\\\": \\\"FQoDYXdzEOf//////////wEaDDwBJ3jkRXXXXXXXXXXXXXXXXXXXXXXXvu8hRdXhhb9KEV3VUTiKxHJGmgkT3nd2FbNRJrWYLVG7acZk+Qr4XXXXXXXXXXXXXXXXXXXXG2g6K2tlh/QgMBGLBQ+/nMli2cKuh/CKGSZ3KibspxO+0t35v5rXXXXXXXXXXXXXXXXXXXXXXpYyhih7u1Q8iRSxmtjMf9uRg7RIZa8usnPRZhuAIU9Kc7Y+pJ8gIjTRZQdx5bdaU6hPJQXXXXXXXXXXXXXXXR9XK8Io4m49KzeXV6vKgAd9OV77f0kUc3mOVK2PMrzvOWCTykAjvYeC9XXXXXXXXXXXXXXXXXdEvuiDPZoMAPZ8cXRy3ts5WEr8eVBIaEj+nEtFQrAww3NCytRSXXXXXXXXXX208pDwsVNSMeKMKB/M4F\\\",\\n    \\\"objectKey\\\": \\\"9XXXXXX-7XX9-4XX5-bXX2-b07XXXXXX40b/FILE0013.MP4\\\",\\n    \\\"bucketName\\\": \\\"s3-bucket\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"fileName\",\n    \"0-1\": \"The asset's file name.\",\n    \"1-0\": \"sessionId\",\n    \"1-1\": \"This id refers to the aws S3 upload session of your asset.\",\n    \"2-0\": \"assetUrl\",\n    \"2-1\": \"This is the url that points to the asset that has been uploaded to S3\",\n    \"3-0\": \"expiration\",\n    \"3-1\": \"The exact time your temporary credentials expire in milliseconds.\",\n    \"4-0\": \"accessKey\",\n    \"4-1\": \"AWS access key.\",\n    \"5-0\": \"secretKey\",\n    \"6-0\": \"sessionToken\",\n    \"7-0\": \"objectKey\",\n    \"8-0\": \"bucketName\",\n    \"5-1\": \"AWS secret key.\",\n    \"6-1\": \"AWS session token.\",\n    \"7-1\": \"This is the path where your asset will be uploaded to in S3.\",\n    \"8-1\": \"Name of the bucket in S3 where your asset will be stored.\"\n  },\n  \"cols\": 2,\n  \"rows\": 9\n}\n[/block]\nThis response contains all we need to start the upload process. It also includes the assetUrl which will be used at the end when we create the asset.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 2: Multipart Upload\"\n}\n[/block]\nMultipart Upload can be done in a browser (via JavaScript) or using any number of server side languages (Java, PHP, Python, Node, etc.). We take advantage of the AWS Javascript SDK to accomplish this. This SDK is supported in many languages.\n\nFor supported file types, take a look at our [support documents](https://support.mediasilo.com/hc/en-us/articles/115005250928-Supported-File-Formats).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var credentials = new AWS.Credentials({ \\n  accessKeyId, \\n  secretAccessKey, \\n  sessionToken \\n});\\nvar service = new AWS.S3({ credentials });\\nvar managedUpload = new AWS.S3.ManagedUpload({ \\n  params: { \\n    Bucket, \\n    Key, \\n    Body \\n  }, \\n  service \\n});\\nmanagedUpload.computeChecksums = true;// must be true. see docs for more details\\nmanagedUpload.send();\",\n      \"language\": \"javascript\"\n    },\n    {\n      \"code\": \"curl -X PUT \\\"https://s3.amazonaws.com/ingest-east.mediasilo.com/26a35865-ffff-bbbb-b9af-1999d2c7835b/MyVideo.mov\\\" -H \\\"Authorization: AWS AKIAIFFFICBLRC7JU6RA:bF4dV+HkF30vCct4V1/uRKjPDFo=\\\" -H \\\"x-amz-acl:private\\\" -H \\\"Content-Type: video/quicktime\\\" -H \\\"x-amz-date: Mon, 19 Jan 2015 19:17:33 GMT\\\" -T videos/MyVideo.mov\",\n      \"language\": \"json\",\n      \"name\": \"CURL\"\n    }\n  ]\n}\n[/block]\n1. The multipartUploadTicketObject allows us to create a credentials object. (Amazon Docs) http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Credentials.html\n2. The credentials object allows us to create an S3 service object. (Amazon Docs) http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html\n3. The S3 service object allows us to create a ManagedUpload object. (Amazon Docs) http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3/ManagedUpload.html\n\nThe managedUpload.send() call will start and finish the multipart upload.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Data Fields\",\n  \"body\": \"All data needs to be passed along exactly as it was returned in the ticket request.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Create Asset\"\n}\n[/block]\nOnce the file is uploaded successfully you have 24 hours to create an asset before the content is deleted. [create the asset](http://docs.mediasilo.com/v3.0/docs/create-asset) using the API as usual.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /v3/assets\\n{\\n    \\\"sourceUrl\\\": \\\"https://s3.amazonaws.com/s3-bucket/26a35865-282f-4aa2-b9af-1999d2c7835b/myfile.mov\\\",\\n    \\\"projectId\\\": \\\"0XXXCC-014B-2XX0-CF518DXXXX393E\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"4. Refreshing Credentials\"\n}\n[/block]\nThis defines the refresh function for the AWS.Credentials object. It can now be used on any Credentials object in scope.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"AWS.Credentials.prototype.refresh = function (callback) {\\n            var self = this;\\n            refreshTemporaryCredentials(function (err, response) {\\n                if (err) {\\n                    callback(err);\\n                } else {\\n                    self.accessKeyId = response.accessKey;\\n                    self.secretAccessKey = response.secretKey;\\n                    self.sessionToken = response.sessionToken;\\n                    callback();\\n                }\\n            });\\n        };\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nThis is the function that makes a POST request to the Mediasilo API to get the refreshed credentials.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"function refreshTemporaryCredentials(callback) {\\n    var xhrRefreshCreds = new XMLHttpRequest();\\n    xhrRefreshCreds.open('POST', 'https://api.mediasilo.com/v3/assets/multipart/upload', true);\\n    xhrRefreshCreds.setRequestHeader('Authorization', 'Basic ' + btoa(userName + \\\":\\\" + password));\\n    xhrRefreshCreds.setRequestHeader('Content-Type', 'application/json');\\n    xhrRefreshCreds.setRequestHeader('MediaSiloHostContext', hostName);\\n    xhrRefreshCreds.onreadystatechange = function () {\\n        if (xhrRefreshCreds.readyState == 4 && xhrRefreshCreds.status == 200) {\\n            console.log(\\\"Finished refreshing temporary credentials\\\");\\n            var refreshedCreds = JSON.parse(xhrRefreshCreds.responseText);\\n            callback(null, refreshedCreds);\\n        }\\n     }\\n            xhrRefreshCreds.send(JSON.stringify({ 'fileName': fileName,         'sessionId': sessionId }));\\n}\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nThis is the refresh interval that determines when to call the refresh function. We are refreshing every 30 minutes to ensure that no AWS request are made with invalid credentials.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var refreshInterval = setInterval(() => {\\n   credentials.refresh(function () {\\n       console.log(\\\"Temporary Credentials have been successfully refreshed.\\\")\\n   });\\n}, 1800000);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Here is a full JavaScript example:\"\n}\n[/block]\nIf you have an existing Mediasilo account, you will be able to run this example fairly easy.\n\n1. Copy and Paste this code into a file, and name it \"index.html\". \n2. Because you already have a Mediasilo Account, you can fill in the variables hostName, userName, \nand password, with the same values that you use to login with. \n3. Get the project Id from any existing project in your account, and set that as your projectId:   \n    Follow steps a - d to get a project id if you don't know how:\n        a. Login into your Mediasilo Account. Make sure you have at least 1 project created.\n        b. Open the browser's Dev Tools (I recommend using Google Chrome: hotkey = cmd+option+i).\n        c. Now that you have the Dev Tools open, refresh the page.\n        d. Click the \"Network\" tab, and you can now filter through the requests using the keyword \n            \"project\". The response to that request will have your Id.\n4. Once you have hardcoded hostName, userName, password, and projectId. You can open your index.html file in a browser, and upload a file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!DOCTYPE html>\\n<html>\\n\\n<head>\\n  <meta charset=\\\"UTF-8\\\">\\n  <title>MediaSilo API - JavaScript Upload Example</title>\\n\\n  <!--\\n    The script tag below gives us access to the AWS Javascript SDK.\\n    This allows us to use the MangedUpload class, which handles \\n    the entire multipart upload process.\\n    -->\\n  <script src=\\\"https://sdk.amazonaws.com/js/aws-sdk-2.20.0.min.js\\\"></script>\\n\\n  <script>\\n\\n    /*\\n    *Variables that you have to fill in by you.\\n    *NOTE** You must have an active Mediasilo account. The same hostName,\\n    *userName, and password you use to login to mediasilo.com with, are used here.\\n    */\\n    var hostName = '';\\n    var userName = '';\\n    var password = '';\\n    var projectId = '';//This id references a real project in your Mediasilo account. This will be the final destination for the new asset.\\n\\n    /*\\n    *Global variables needed throughout the asset create process.\\n    */\\n    var fileName;//The asset's file name.\\n    var sessionId;//This id refers to the aws S3 upload session of your asset.\\n\\n\\n    /*\\n    *When the upload button in the browser is clicked, this function \\n    *will start the asset create process.\\n    *\\n    *Step 1: Create a multipart upload ticket. This will have all the information \\n    *needed to upload the asset to S3. This includes fileName, sessionId, assetUrl, expiration, \\n    *accessKey, secretKey, sessionToken, objectKey(path in S3 where the file is stored), and\\n    *bucketName.\\n    *\\n    *Step 2: Upload the asset to S3. Once the upload is complete, the assetUrl will be  \\n    *accessible to create the asset in your Mediasilo account. NOTE** Although the assetUrl\\n    *is returned in the multipart upload ticket, the assetUrl is not accessible until the\\n    *upload is complete.\\n    *\\n    *Step 3: Create the asset. Using the assetUrl and projectId, create the asset inside the\\n    *desired project. Note** the projectId is the id of an existinbg project inside of your\\n    *Mediasilo account.\\n    */\\n    function startAssetCreateProcess() {\\n      //Step 1:\\n      createMultipartUploadTicket();\\n    }\\n\\n    function createMultipartUploadTicket() {\\n      var filePath = document.getElementById('file').value;//The exact path to the file on your computer.\\n      fileName = filePath.replace(/^.*?([^\\\\\\\\\\\\/]*)$/, '$1');//The name of your file which is extracted from the file path.\\n\\n      /*\\n      *This is the POST request that is made to the API that returns the              \\n      *information needed to uploada file to S3, then later create an asset \\n      */\\n      var xhrMultipartUploadTicket = new XMLHttpRequest();\\n      xhrMultipartUploadTicket.open('POST', 'https://api.mediasilo.com/v3/assets/multipart/upload', true);\\n      xhrMultipartUploadTicket.setRequestHeader('Authorization', 'Basic ' + btoa(userName + \\\":\\\" + password));\\n      xhrMultipartUploadTicket.setRequestHeader('Content-Type', 'application/json');\\n      xhrMultipartUploadTicket.setRequestHeader('MediaSiloHostContext', hostName);\\n      xhrMultipartUploadTicket.onreadystatechange = function () {\\n        if (xhrMultipartUploadTicket.readyState == 4 && xhrMultipartUploadTicket.status == 200) {\\n          console.log(\\\"Finished creating the multipart upload ticket.\\\");\\n          //Step 2:\\n          uploadFileToS3(xhrMultipartUploadTicket.responseText);\\n        }\\n      }\\n      xhrMultipartUploadTicket.send(JSON.stringify({ 'fileName': fileName }));\\n    }\\n\\n    function uploadFileToS3(multipartUploadTicket) {\\n      var Body = document.getElementById('file').files[0];\\n      var multipartUploadTicketObject = JSON.parse(multipartUploadTicket);\\n\\n      //This is the multipartUploadTicketObject deconstructed so we can clearly see the information we have access to.\\n      fileName = multipartUploadTicketObject.fileName;\\n      sessionId = multipartUploadTicketObject.sessionId;\\n      var assetUrl = multipartUploadTicketObject.assetUrl;//This is the url that points to the asset that has been uploaded to S3\\n      var expireTime = multipartUploadTicketObject.expiration;//The exact time your temporary credentials expire.\\n      var accessKeyId = multipartUploadTicketObject.accessKey;//AWS access key.\\n      var secretAccessKey = multipartUploadTicketObject.secretKey;//AWS secret key.\\n      var sessionToken = multipartUploadTicketObject.sessionToken;//AWS session token.\\n      var Key = multipartUploadTicketObject.objectKey;//This is the path where your asset will be uploaded to in S3.\\n      var Bucket = multipartUploadTicketObject.bucketName;//Name of the bucket in S3 where your asset will be stored.\\n\\n      var credentials = new AWS.Credentials({ accessKeyId, secretAccessKey, sessionToken });//The multipartUploadTicketObject allows us to create a credentials object\\n      var service = new AWS.S3({ credentials });//The credentials object allows us to create an S3 service object.\\n      var managedUpload = new AWS.S3.ManagedUpload({ params: { Bucket, Key, Body }, service });//The S3 service object allows us to create a ManagedUpload object.\\n      managedUpload.computeChecksums = true;\\n      managedUpload.send();\\n      managedUpload.promise().then(function () {\\n        //Step 3:\\n        createAsset(assetUrl);//We do not want to create the asset until the upload to S3 in finished.\\n      });\\n      \\n      //This will update the upload progress bar everytime the httpUploadProgress event is omitted.\\n            //The event is omitted every time a single part is uploaded successfully\\n            managedUpload.on('httpUploadProgress', function (progress) {\\n                document.getElementById(\\\"progressNumber\\\").value = (progress.loaded / progress.total) * 100;\\n                //console.log((progress.loaded / progress.total) * 100);\\n            })\\n\\n      /*\\n      *Temporary Credentials expire 1 hour after they are created or refreshed. \\n      *This interval will refresh the temporary credentials every 55 minutes.\\n      *This ensures that uploads needing longer than one hour will complete.\\n      */\\n      var refreshInterval = setInterval(() => {\\n        credentials.refresh(function () {\\n          console.log(\\\"Temporary Credentials have been successfully refreshed.\\\")\\n        });\\n      }, 1800000);//1,800,000 milliseconds = 30 minutes. Reducing this number will increase the frequency at which your temporary credentials are refreshed.\\n    }//If this number exceeds 3,599,999 then your upload will fail before your temporary credentials are refreshed. The slower your internet\\n    //upload speed, the more frequent you want to refresh your credentials.\\n\\n    function createAsset(assetPath) {\\n      /*\\n      *This is the POST request that is made to the API that creates your asset.\\n      *This will return the id of the asset that was created. \\n      */\\n      xhrCreate = new XMLHttpRequest();\\n      xhrCreate.open('POST', 'https://api.mediasilo.com/v3/assets', true);\\n      xhrCreate.setRequestHeader('Authorization', 'Basic ' + btoa(userName + \\\":\\\" + password));\\n      xhrCreate.setRequestHeader('Content-Type', 'application/json');\\n      xhrCreate.setRequestHeader('MediaSiloHostContext', hostName);\\n      xhrCreate.onreadystatechange = function () {\\n        if (xhrCreate.readyState == 4 && xhrCreate.status == 200) {\\n          //All Done! Your asset has been created.\\n          alert('Asset Created! Response: ' + xhrCreate.responseText);\\n        }\\n      }\\n      xhrCreate.send(JSON.stringify({ 'sourceUrl': assetPath, 'projectId': projectId }));\\n    }\\n\\n    /*\\n    *This block of code defines how the refresh() function will work.\\n    *Any AWS.Credentials object that is created may use this refresh function.\\n    */\\n    AWS.Credentials.prototype.refresh = function (callback) {\\n      var self = this;\\n      refreshTemporaryCredentials(function (err, response) {\\n        if (err) {\\n          callback(err);\\n        } else {\\n          self.accessKeyId = response.accessKey;\\n          self.secretAccessKey = response.secretKey;\\n          self.sessionToken = response.sessionToken;\\n          callback();\\n        }\\n      });\\n    };\\n\\n    /*\\n    *This function is almost identical to the createMultipartUploadTicket. The main difference\\n    *is that we are passing along a sessionId with a fileName when we make the POST request. \\n    *With the addition of the sessonId, the will API know to refresh your credentials.\\n    * \\n    *NOTE**This refresh function does actually return new temporary credentials. The access key\\n    *and secret key will be different than the previous keys. The 2 important things to understand\\n    *are that 1: the new temporary credentials have the exact same permissions as the previous credentials,\\n    *and 2: the expireTime on the new temporary credentials is roughly 1 more hour than the previous\\n    *credentials. This allows the credentials to be interchangeable, even in the middle of an upload. \\n    */\\n    function refreshTemporaryCredentials(callback) {\\n      var xhrRefreshCreds = new XMLHttpRequest();\\n      xhrRefreshCreds.open('POST', 'https://api.mediasilo.com/v3/assets/multipart/upload', true);\\n      xhrRefreshCreds.setRequestHeader('Authorization', 'Basic ' + btoa(userName + \\\":\\\" + password));\\n      xhrRefreshCreds.setRequestHeader('Content-Type', 'application/json');\\n      xhrRefreshCreds.setRequestHeader('MediaSiloHostContext', hostName);\\n      xhrRefreshCreds.onreadystatechange = function () {\\n        if (xhrRefreshCreds.readyState == 4 && xhrRefreshCreds.status == 200) {\\n          console.log(\\\"Finished refreshing temporary credentials\\\");\\n          var refreshedCreds = JSON.parse(xhrRefreshCreds.responseText);\\n          callback(null, refreshedCreds);\\n        }\\n      }\\n      xhrRefreshCreds.send(JSON.stringify({ 'fileName': fileName, 'sessionId': sessionId }));\\n    }\\n\\n  </script>\\n\\n</head>\\n\\n<body>\\n  <span>File</span>\\n  <input type=\\\"file\\\" id=\\\"file\\\" name=\\\"file\\\" size=\\\"10\\\" />\\n  <input id=\\\"uploadbutton\\\" type=\\\"button\\\" value=\\\"Upload\\\" onclick=\\\"startAssetCreateProcess();\\\" />\\n    \\n    <p>Upload Progress\\n        <meter id=\\\"progressNumber\\\" min=\\\"0\\\" max=\\\"100\\\" value=\\\"0\\\">350 degrees</meter>.\\n    </p>\\n</body>\\n\\n</html>\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]","excerpt":"Request a multipart upload ticket to upload files larger than 5GB directly to MediaSilo","slug":"multipart-upload","type":"endpoint","title":"Multipart Upload"}

postMultipart Upload

Request a multipart upload ticket to upload files larger than 5GB directly to MediaSilo

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

fileName:
required
string
Name of the file to be stored.
sessionId:
string
The session id refers to the upload session in which the file is being uploaded

Examples


Result Format


Documentation

Requesting a multipartUploadTicket returns all information necessary to perform a file upload directly to S3. Files uploaded using this process do not have a limited file size. [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Description", "0-0": "fileName", "0-1": "This is the file name as it will be stored in S3. It does not have to be the actual name of the local file.", "1-0": "sessionId", "1-1": "A session id is passed in to refresh already existing, unexpired temporary credentials. Temporary credentials expire after 1 hour. To complete an upload that takes longer than 1 hour, temporary credentials must be refreshed. Passing in the sessionId lets the refreshed credentials have access to the current upload session to continue uploading the file." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "title": "Overview of Multipart Upload" } [/block] Step 1: Create a multipart upload ticket. This will have all the information needed to upload the asset to S3. This includes fileName, sessionId, assetUrl, expiration, accessKey, secretKey, sessionToken, objectKey(path in S3 where the file is stored), and bucketName. Refreshing Temporary Credentials: (Temp Creds expire after 1 hour from the time they were created.) When requesting temporary credentials, you pass in the file name. When you start uploading the file to S3, the sessionId is the reference to that upload session. To refresh temporary credentials, we pass the file name and the sessionId. This way, the refreshed credentials have access to that specific upload session. Then the credentials are interchangeable since they have the same access. There is a code example on refreshing credentials using the Mediasilo API further down this page. Step 2: Upload the asset to S3. Once the upload is complete, the assetUrl will be accessible to create the asset in your Mediasilo account. NOTE** Although the assetUrl is returned in the multipart upload ticket, the assetUrl is not accessible until the upload is complete. Step 3: Create the asset. Using the assetUrl and projectId, create the asset inside the desired project. Note** the projectId is the id of an EXISTING project inside of your Mediasilo account. [block:api-header] { "type": "basic", "title": "Step 1: Create the Multipart Upload Ticket" } [/block] Let's assume we sent the following request to obtain an multipart upload ticket: [block:code] { "codes": [ { "code": "POST /v3/assets/multipart/upload\n{\n \"fileName\": \"FILE0013.MP4\"\n}", "language": "json" } ] } [/block] And we receive the following payload in response: [block:code] { "codes": [ { "code": "//200 OK\n{\n \"fileName\": \"FILE0013.MP4\",\n \"assetUrl\": \"https://s3.amazonaws.com/s3-bucket/9XXXXXX-7XX9-4XX5-bXX2-b07XXXXXX40b/FILE0013.MP4\",\n \"expiration\": 1507790546000,\n \"accessKey\": \"ASIAJCPLGOLJYYTKUXRQ\",\n \"secretKey\": \"TWfwinpU3YRUXzIN/UoSCqsoobOYKBAIpWMC4Si3\",\n \"sessionId\": \"9XXXXXX-7XX9-4XX5-bXX2-b07XXXXXX40b\",\n \"sessionToken\": \"FQoDYXdzEOf//////////wEaDDwBJ3jkRXXXXXXXXXXXXXXXXXXXXXXXvu8hRdXhhb9KEV3VUTiKxHJGmgkT3nd2FbNRJrWYLVG7acZk+Qr4XXXXXXXXXXXXXXXXXXXXG2g6K2tlh/QgMBGLBQ+/nMli2cKuh/CKGSZ3KibspxO+0t35v5rXXXXXXXXXXXXXXXXXXXXXXpYyhih7u1Q8iRSxmtjMf9uRg7RIZa8usnPRZhuAIU9Kc7Y+pJ8gIjTRZQdx5bdaU6hPJQXXXXXXXXXXXXXXXR9XK8Io4m49KzeXV6vKgAd9OV77f0kUc3mOVK2PMrzvOWCTykAjvYeC9XXXXXXXXXXXXXXXXXdEvuiDPZoMAPZ8cXRy3ts5WEr8eVBIaEj+nEtFQrAww3NCytRSXXXXXXXXXX208pDwsVNSMeKMKB/M4F\",\n \"objectKey\": \"9XXXXXX-7XX9-4XX5-bXX2-b07XXXXXX40b/FILE0013.MP4\",\n \"bucketName\": \"s3-bucket\"\n}", "language": "json" } ] } [/block] [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Description", "0-0": "fileName", "0-1": "The asset's file name.", "1-0": "sessionId", "1-1": "This id refers to the aws S3 upload session of your asset.", "2-0": "assetUrl", "2-1": "This is the url that points to the asset that has been uploaded to S3", "3-0": "expiration", "3-1": "The exact time your temporary credentials expire in milliseconds.", "4-0": "accessKey", "4-1": "AWS access key.", "5-0": "secretKey", "6-0": "sessionToken", "7-0": "objectKey", "8-0": "bucketName", "5-1": "AWS secret key.", "6-1": "AWS session token.", "7-1": "This is the path where your asset will be uploaded to in S3.", "8-1": "Name of the bucket in S3 where your asset will be stored." }, "cols": 2, "rows": 9 } [/block] This response contains all we need to start the upload process. It also includes the assetUrl which will be used at the end when we create the asset. [block:api-header] { "type": "basic", "title": "Step 2: Multipart Upload" } [/block] Multipart Upload can be done in a browser (via JavaScript) or using any number of server side languages (Java, PHP, Python, Node, etc.). We take advantage of the AWS Javascript SDK to accomplish this. This SDK is supported in many languages. For supported file types, take a look at our [support documents](https://support.mediasilo.com/hc/en-us/articles/115005250928-Supported-File-Formats). [block:code] { "codes": [ { "code": "var credentials = new AWS.Credentials({ \n accessKeyId, \n secretAccessKey, \n sessionToken \n});\nvar service = new AWS.S3({ credentials });\nvar managedUpload = new AWS.S3.ManagedUpload({ \n params: { \n Bucket, \n Key, \n Body \n }, \n service \n});\nmanagedUpload.computeChecksums = true;// must be true. see docs for more details\nmanagedUpload.send();", "language": "javascript" }, { "code": "curl -X PUT \"https://s3.amazonaws.com/ingest-east.mediasilo.com/26a35865-ffff-bbbb-b9af-1999d2c7835b/MyVideo.mov\" -H \"Authorization: AWS AKIAIFFFICBLRC7JU6RA:bF4dV+HkF30vCct4V1/uRKjPDFo=\" -H \"x-amz-acl:private\" -H \"Content-Type: video/quicktime\" -H \"x-amz-date: Mon, 19 Jan 2015 19:17:33 GMT\" -T videos/MyVideo.mov", "language": "json", "name": "CURL" } ] } [/block] 1. The multipartUploadTicketObject allows us to create a credentials object. (Amazon Docs) http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Credentials.html 2. The credentials object allows us to create an S3 service object. (Amazon Docs) http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html 3. The S3 service object allows us to create a ManagedUpload object. (Amazon Docs) http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3/ManagedUpload.html The managedUpload.send() call will start and finish the multipart upload. [block:callout] { "type": "info", "title": "Data Fields", "body": "All data needs to be passed along exactly as it was returned in the ticket request." } [/block] [block:api-header] { "type": "basic", "title": "3. Create Asset" } [/block] Once the file is uploaded successfully you have 24 hours to create an asset before the content is deleted. [create the asset](http://docs.mediasilo.com/v3.0/docs/create-asset) using the API as usual. [block:code] { "codes": [ { "code": "POST /v3/assets\n{\n \"sourceUrl\": \"https://s3.amazonaws.com/s3-bucket/26a35865-282f-4aa2-b9af-1999d2c7835b/myfile.mov\",\n \"projectId\": \"0XXXCC-014B-2XX0-CF518DXXXX393E\"\n}", "language": "json" } ] } [/block] [block:api-header] { "title": "4. Refreshing Credentials" } [/block] This defines the refresh function for the AWS.Credentials object. It can now be used on any Credentials object in scope. [block:code] { "codes": [ { "code": "AWS.Credentials.prototype.refresh = function (callback) {\n var self = this;\n refreshTemporaryCredentials(function (err, response) {\n if (err) {\n callback(err);\n } else {\n self.accessKeyId = response.accessKey;\n self.secretAccessKey = response.secretKey;\n self.sessionToken = response.sessionToken;\n callback();\n }\n });\n };", "language": "javascript" } ] } [/block] This is the function that makes a POST request to the Mediasilo API to get the refreshed credentials. [block:code] { "codes": [ { "code": "function refreshTemporaryCredentials(callback) {\n var xhrRefreshCreds = new XMLHttpRequest();\n xhrRefreshCreds.open('POST', 'https://api.mediasilo.com/v3/assets/multipart/upload', true);\n xhrRefreshCreds.setRequestHeader('Authorization', 'Basic ' + btoa(userName + \":\" + password));\n xhrRefreshCreds.setRequestHeader('Content-Type', 'application/json');\n xhrRefreshCreds.setRequestHeader('MediaSiloHostContext', hostName);\n xhrRefreshCreds.onreadystatechange = function () {\n if (xhrRefreshCreds.readyState == 4 && xhrRefreshCreds.status == 200) {\n console.log(\"Finished refreshing temporary credentials\");\n var refreshedCreds = JSON.parse(xhrRefreshCreds.responseText);\n callback(null, refreshedCreds);\n }\n }\n xhrRefreshCreds.send(JSON.stringify({ 'fileName': fileName, 'sessionId': sessionId }));\n}", "language": "javascript" } ] } [/block] This is the refresh interval that determines when to call the refresh function. We are refreshing every 30 minutes to ensure that no AWS request are made with invalid credentials. [block:code] { "codes": [ { "code": "var refreshInterval = setInterval(() => {\n credentials.refresh(function () {\n console.log(\"Temporary Credentials have been successfully refreshed.\")\n });\n}, 1800000);", "language": "javascript" } ] } [/block] [block:api-header] { "title": "Here is a full JavaScript example:" } [/block] If you have an existing Mediasilo account, you will be able to run this example fairly easy. 1. Copy and Paste this code into a file, and name it "index.html". 2. Because you already have a Mediasilo Account, you can fill in the variables hostName, userName, and password, with the same values that you use to login with. 3. Get the project Id from any existing project in your account, and set that as your projectId: Follow steps a - d to get a project id if you don't know how: a. Login into your Mediasilo Account. Make sure you have at least 1 project created. b. Open the browser's Dev Tools (I recommend using Google Chrome: hotkey = cmd+option+i). c. Now that you have the Dev Tools open, refresh the page. d. Click the "Network" tab, and you can now filter through the requests using the keyword "project". The response to that request will have your Id. 4. Once you have hardcoded hostName, userName, password, and projectId. You can open your index.html file in a browser, and upload a file. [block:code] { "codes": [ { "code": "<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"UTF-8\">\n <title>MediaSilo API - JavaScript Upload Example</title>\n\n <!--\n The script tag below gives us access to the AWS Javascript SDK.\n This allows us to use the MangedUpload class, which handles \n the entire multipart upload process.\n -->\n <script src=\"https://sdk.amazonaws.com/js/aws-sdk-2.20.0.min.js\"></script>\n\n <script>\n\n /*\n *Variables that you have to fill in by you.\n *NOTE** You must have an active Mediasilo account. The same hostName,\n *userName, and password you use to login to mediasilo.com with, are used here.\n */\n var hostName = '';\n var userName = '';\n var password = '';\n var projectId = '';//This id references a real project in your Mediasilo account. This will be the final destination for the new asset.\n\n /*\n *Global variables needed throughout the asset create process.\n */\n var fileName;//The asset's file name.\n var sessionId;//This id refers to the aws S3 upload session of your asset.\n\n\n /*\n *When the upload button in the browser is clicked, this function \n *will start the asset create process.\n *\n *Step 1: Create a multipart upload ticket. This will have all the information \n *needed to upload the asset to S3. This includes fileName, sessionId, assetUrl, expiration, \n *accessKey, secretKey, sessionToken, objectKey(path in S3 where the file is stored), and\n *bucketName.\n *\n *Step 2: Upload the asset to S3. Once the upload is complete, the assetUrl will be \n *accessible to create the asset in your Mediasilo account. NOTE** Although the assetUrl\n *is returned in the multipart upload ticket, the assetUrl is not accessible until the\n *upload is complete.\n *\n *Step 3: Create the asset. Using the assetUrl and projectId, create the asset inside the\n *desired project. Note** the projectId is the id of an existinbg project inside of your\n *Mediasilo account.\n */\n function startAssetCreateProcess() {\n //Step 1:\n createMultipartUploadTicket();\n }\n\n function createMultipartUploadTicket() {\n var filePath = document.getElementById('file').value;//The exact path to the file on your computer.\n fileName = filePath.replace(/^.*?([^\\\\\\/]*)$/, '$1');//The name of your file which is extracted from the file path.\n\n /*\n *This is the POST request that is made to the API that returns the \n *information needed to uploada file to S3, then later create an asset \n */\n var xhrMultipartUploadTicket = new XMLHttpRequest();\n xhrMultipartUploadTicket.open('POST', 'https://api.mediasilo.com/v3/assets/multipart/upload', true);\n xhrMultipartUploadTicket.setRequestHeader('Authorization', 'Basic ' + btoa(userName + \":\" + password));\n xhrMultipartUploadTicket.setRequestHeader('Content-Type', 'application/json');\n xhrMultipartUploadTicket.setRequestHeader('MediaSiloHostContext', hostName);\n xhrMultipartUploadTicket.onreadystatechange = function () {\n if (xhrMultipartUploadTicket.readyState == 4 && xhrMultipartUploadTicket.status == 200) {\n console.log(\"Finished creating the multipart upload ticket.\");\n //Step 2:\n uploadFileToS3(xhrMultipartUploadTicket.responseText);\n }\n }\n xhrMultipartUploadTicket.send(JSON.stringify({ 'fileName': fileName }));\n }\n\n function uploadFileToS3(multipartUploadTicket) {\n var Body = document.getElementById('file').files[0];\n var multipartUploadTicketObject = JSON.parse(multipartUploadTicket);\n\n //This is the multipartUploadTicketObject deconstructed so we can clearly see the information we have access to.\n fileName = multipartUploadTicketObject.fileName;\n sessionId = multipartUploadTicketObject.sessionId;\n var assetUrl = multipartUploadTicketObject.assetUrl;//This is the url that points to the asset that has been uploaded to S3\n var expireTime = multipartUploadTicketObject.expiration;//The exact time your temporary credentials expire.\n var accessKeyId = multipartUploadTicketObject.accessKey;//AWS access key.\n var secretAccessKey = multipartUploadTicketObject.secretKey;//AWS secret key.\n var sessionToken = multipartUploadTicketObject.sessionToken;//AWS session token.\n var Key = multipartUploadTicketObject.objectKey;//This is the path where your asset will be uploaded to in S3.\n var Bucket = multipartUploadTicketObject.bucketName;//Name of the bucket in S3 where your asset will be stored.\n\n var credentials = new AWS.Credentials({ accessKeyId, secretAccessKey, sessionToken });//The multipartUploadTicketObject allows us to create a credentials object\n var service = new AWS.S3({ credentials });//The credentials object allows us to create an S3 service object.\n var managedUpload = new AWS.S3.ManagedUpload({ params: { Bucket, Key, Body }, service });//The S3 service object allows us to create a ManagedUpload object.\n managedUpload.computeChecksums = true;\n managedUpload.send();\n managedUpload.promise().then(function () {\n //Step 3:\n createAsset(assetUrl);//We do not want to create the asset until the upload to S3 in finished.\n });\n \n //This will update the upload progress bar everytime the httpUploadProgress event is omitted.\n //The event is omitted every time a single part is uploaded successfully\n managedUpload.on('httpUploadProgress', function (progress) {\n document.getElementById(\"progressNumber\").value = (progress.loaded / progress.total) * 100;\n //console.log((progress.loaded / progress.total) * 100);\n })\n\n /*\n *Temporary Credentials expire 1 hour after they are created or refreshed. \n *This interval will refresh the temporary credentials every 55 minutes.\n *This ensures that uploads needing longer than one hour will complete.\n */\n var refreshInterval = setInterval(() => {\n credentials.refresh(function () {\n console.log(\"Temporary Credentials have been successfully refreshed.\")\n });\n }, 1800000);//1,800,000 milliseconds = 30 minutes. Reducing this number will increase the frequency at which your temporary credentials are refreshed.\n }//If this number exceeds 3,599,999 then your upload will fail before your temporary credentials are refreshed. The slower your internet\n //upload speed, the more frequent you want to refresh your credentials.\n\n function createAsset(assetPath) {\n /*\n *This is the POST request that is made to the API that creates your asset.\n *This will return the id of the asset that was created. \n */\n xhrCreate = new XMLHttpRequest();\n xhrCreate.open('POST', 'https://api.mediasilo.com/v3/assets', true);\n xhrCreate.setRequestHeader('Authorization', 'Basic ' + btoa(userName + \":\" + password));\n xhrCreate.setRequestHeader('Content-Type', 'application/json');\n xhrCreate.setRequestHeader('MediaSiloHostContext', hostName);\n xhrCreate.onreadystatechange = function () {\n if (xhrCreate.readyState == 4 && xhrCreate.status == 200) {\n //All Done! Your asset has been created.\n alert('Asset Created! Response: ' + xhrCreate.responseText);\n }\n }\n xhrCreate.send(JSON.stringify({ 'sourceUrl': assetPath, 'projectId': projectId }));\n }\n\n /*\n *This block of code defines how the refresh() function will work.\n *Any AWS.Credentials object that is created may use this refresh function.\n */\n AWS.Credentials.prototype.refresh = function (callback) {\n var self = this;\n refreshTemporaryCredentials(function (err, response) {\n if (err) {\n callback(err);\n } else {\n self.accessKeyId = response.accessKey;\n self.secretAccessKey = response.secretKey;\n self.sessionToken = response.sessionToken;\n callback();\n }\n });\n };\n\n /*\n *This function is almost identical to the createMultipartUploadTicket. The main difference\n *is that we are passing along a sessionId with a fileName when we make the POST request. \n *With the addition of the sessonId, the will API know to refresh your credentials.\n * \n *NOTE**This refresh function does actually return new temporary credentials. The access key\n *and secret key will be different than the previous keys. The 2 important things to understand\n *are that 1: the new temporary credentials have the exact same permissions as the previous credentials,\n *and 2: the expireTime on the new temporary credentials is roughly 1 more hour than the previous\n *credentials. This allows the credentials to be interchangeable, even in the middle of an upload. \n */\n function refreshTemporaryCredentials(callback) {\n var xhrRefreshCreds = new XMLHttpRequest();\n xhrRefreshCreds.open('POST', 'https://api.mediasilo.com/v3/assets/multipart/upload', true);\n xhrRefreshCreds.setRequestHeader('Authorization', 'Basic ' + btoa(userName + \":\" + password));\n xhrRefreshCreds.setRequestHeader('Content-Type', 'application/json');\n xhrRefreshCreds.setRequestHeader('MediaSiloHostContext', hostName);\n xhrRefreshCreds.onreadystatechange = function () {\n if (xhrRefreshCreds.readyState == 4 && xhrRefreshCreds.status == 200) {\n console.log(\"Finished refreshing temporary credentials\");\n var refreshedCreds = JSON.parse(xhrRefreshCreds.responseText);\n callback(null, refreshedCreds);\n }\n }\n xhrRefreshCreds.send(JSON.stringify({ 'fileName': fileName, 'sessionId': sessionId }));\n }\n\n </script>\n\n</head>\n\n<body>\n <span>File</span>\n <input type=\"file\" id=\"file\" name=\"file\" size=\"10\" />\n <input id=\"uploadbutton\" type=\"button\" value=\"Upload\" onclick=\"startAssetCreateProcess();\" />\n \n <p>Upload Progress\n <meter id=\"progressNumber\" min=\"0\" max=\"100\" value=\"0\">350 degrees</meter>.\n </p>\n</body>\n\n</html>", "language": "javascript" } ] } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}