title: Vimeo API file upload constantly returning 308 response
body: <p>I've been stuck on this issue for over a week now, and have contacted Vimeo support but getting nowhere. Have read all the posts on here with similar issues but still no fix. The closest similar post is <a href="https://stackoverflow.com/questions/26222413/vimeo-api-streaming-upload-using-http-put-and-blueimps-jquery-fileupload">Vimeo API : streaming upload using HTTP PUT and blueimp&#39;s jQuery fileupload</a></p>
  
  <p>..but i'm not using the jQuery fileupload plugin so that option doesn't apply (I'm using <code>jQuery.ajax</code>. </p>
  
  <p>Anyway, i'm trying to upload videos using the HTTP PUT method (<a href="https://developer.vimeo.com/api/upload/videos#resumable-http-put-uploads" rel="nofollow noreferrer">https://developer.vimeo.com/api/upload/videos#resumable-http-put-uploads</a>)</p>
  
  <p>I've generated an upload ticket as in step 1, and then sent a PUT request to the <code>upload_link_secure</code> as in step 2. Here is the request..</p>
  
  <pre><code>Request URL:https://1511923893.cloud.vimeo.com/upload?ticket_id=9b867d91d7e7f83bb31f0690b6331ac0&amp;video_file_id=522193134&amp;signature=89c47a9b3bfc4a0ece830b75d1845e86&amp;v6=1
  
  Accept:*/*
  Accept-Encoding:gzip, deflate, sdch
  Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
  Connection:keep-alive
  Content-Length:10498886
  Content-Type:video/mp4
  Host:1511923893.cloud.vimeo.com
  Origin:http://www.talentgapp.local
  Referer:http://www.talentgapp.local/
  User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36
  </code></pre>
  
  <p>And the response..</p>
  
  <pre><code>Request URL:https://1511923893.cloud.vimeo.com/upload?ticket_id=9b867d91d7e7f83bb31f0690b6331ac0&amp;video_file_id=522193134&amp;signature=89c47a9b3bfc4a0ece830b75d1845e86&amp;v6=1
  Request Method:PUT
  Status Code:200 OK
  Remote Address:54.78.176.185:443
  </code></pre>
  
  <p>Response Headers</p>
  
  <pre><code>Access-Control-Allow-Headers:Content-Type, Content-Range,  X-Requested-With
  Access-Control-Allow-Methods:POST, PUT, GET, OPTIONS
  Access-Control-Allow-Origin:*
  Access-Control-Expose-Headers:Range
  Connection:close
  Content-Length:0
  Content-Type:text/plain
  Date:Thu, 28 Apr 2016 11:39:53 GMT
  Server:Vimeo/1.0
  Timing-Allow-Origin:*
  X-Backend-Server:kopiluwak
  X-Requested-With:XMLHttpRequest
  </code></pre>
  
  <p>So far so good - the video even appears in my Vimeo account (but is in "uploading" status and never completes)</p>
  
  <p>So, as recommended by the Vimeo docs, I then attempt to verify the upload as in step 3 (supplying the same request parameters as before, with the exception of the file data, and with the addition of the <code>Content-Range: bytes */*</code> header:</p>
  
  <p>Request:</p>
  
  <pre><code>Accept:*/*
  Accept-Encoding:gzip, deflate, sdch
  Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
  Connection:keep-alive
  Content-Length:0
  Content-Range:bytes */*
  Content-Type:video/mp4
  Host:1511923893.cloud.vimeo.com
  Origin:http://www.talentgapp.local
  Referer:http://www.talentgapp.local/
  User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36
  </code></pre>
  
  <p>And the response...</p>
  
  <pre><code>Request URL:https://1511923893.cloud.vimeo.com/upload?ticket_id=9b867d91d7e7f83bb31f0690b6331ac0&amp;video_file_id=522193134&amp;signature=89c47a9b3bfc4a0ece830b75d1845e86&amp;v6=1
  Request Method:PUT
  Status Code:308 Resume Incomplete
  Remote Address:54.78.176.185:443
  </code></pre>
  
  <p>Response headers..</p>
  
  <pre><code>Access-Control-Allow-Headers:Content-Type, Content-Range,  X-Requested-With
  Access-Control-Allow-Methods:POST, PUT, GET, OPTIONS
  Access-Control-Allow-Origin:*
  Access-Control-Expose-Headers:Range
  Connection:close
  Content-Length:0
  Content-Type:text/plain
  Date:Thu, 28 Apr 2016 11:39:53 GMT
  Range:bytes=0-10498886
  Server:Vimeo/1.0
  Timing-Allow-Origin:*
  X-Backend-Server:kopiluwak
  X-Requested-With:XMLHttpRequest
  </code></pre>
  
  <p>As you can see I am getting <code>Range:bytes=0-10498886</code> in the 308 response. I repeat this request several times but the <code>Range</code> header is always <code>bytes=0-10498886</code> and I never get a 200 response to confirm the upload has completed.</p>
  
  <p>As such, if I perform the <code>DELETE</code> request as described in step 4 i get <code>error 500: Invalid state</code>.</p>
  
  <p>Anybody have any ideas?</p>