Friday, April 1, 2011

[YouTube-API] [ERROR] Browser-based Uploading

Hello everybody,

I' m following the tutoriel of the documentation in order to upload video.But without result, i hope someone can help me...

The first two steps (Step 1 - Uploading video metadata; Step 2 - Extracting values from the API response) pass with no problem at all:
I obtain well the URL and the TOKEN send by the API.

But the last step (Step 3 - Uploading the video file) does not work:
I receive: Internal Error

This is my code (the same that the documentation):

<?php
////////////////////////          Retour de la part de U Tube               //////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
   $tokenHandlerUrl = 'http://gdata.youtube.com/action/GetUploadToken';
   $tokenArray = $yt->getFormUploadToken($myVideoEntry, $tokenHandlerUrl);
   $tokenValue = $tokenArray['token'];
   $postUrl = $tokenArray['url'];

//////////////////////// Formulaire pour choix de la video ///////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Page sur laquelle sera renvoyé l'utilisateur après la validation
// du formulaire (URL de retour)
   $nextUrl = 'http://localhost/test/ok.php';

// Affichage du formulaire
$form = '<form action="'.htmlspecialchars($postUrl, ENT_QUOTES).'?nexturl='.urlencode($nextUrl).'" method="post" enctype="multipart/formdata">
Fichier vidéo : <input name="file" type="file"/>
<input name="token" type="hidden" value="'. $tokenValue .'"/>
<input value="Envoyer la vidéo" type="submit" />
</form>';

echo $form;
?>


Please help...

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment