title: curl response for youtube upload
body: <p>I have another question concerning YouTube upload. Based on the answer that I received from khael here (<a href="https://stackoverflow.com/questions/10918115/replace-form-input-file-with-direct-file-upload">replace form input file with direct file upload</a>), the script uploads the video perfectly. However, the curl response is "Moved Temporarily". What I need instead is to get the YouTube video ID back. </p>
  
  <p>Another problem is that the "nexturl" never gets called. If it was called, I could easily read the video id with "$_GET['id']" and write it to the database.</p>
  
  <p>Here the code I'm working with</p>
  
  <pre><code>$ch = curl_init($response-&gt;url."?nexturl=".urlencode($nexturl));
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_VERBOSE, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);
  curl_setopt($ch, CURLOPT_POST, true);
  $post = array(
     "file"=&gt;"@/path/to/file.avi",
     "token"=&gt;$response-&gt;token
  );
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
  $response = curl_exec($ch);
  </code></pre>
  
  <p>Thanks,
  Florian</p>