Click here to Skip to main content
15,891,789 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Now I only have a simple form and it can upload to my server. And now I want to upload to my server and also upload to youtube. The Youtube API direct upload is 100% what I require. But I have no idea how to start it. I have seen the code on Google[^] but I don't know where to place the code. Please give me a hand. Thanks
Posted
Updated 13-Jan-10 14:58pm
v2

1 solution

I'm almost certain that you currently have something like this:
move_uploaded_file( $_FILES[ 'video_field' ][ 'tmp_name' ] , $destinationFolder . $_FILES[ 'video_field' ][ 'name' ]

You should put the API code after that line and then replace 'file.mov' with $destinationFolder . $_FILES[ 'video_field' ][ 'name' ].

E.g.
// create a new Zend_Gdata_App_MediaFileSource object
$filesource = $yt->newMediaFileSource($destinationFolder . $_FILES[ 'video_field' ][ 'name' ]);
$filesource->setContentType('video/quicktime');
// set slug header
$filesource->setSlug($destinationFolder . $_FILES[ 'video_field' ][ 'name' ]);

Simple.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900