Click here to Skip to main content
15,879,613 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
Updated 13-Jan-10 14:58pm

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 '' with $destinationFolder . $_FILES[ 'video_field' ][ 'name' ].

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

Share this answer

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