Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function base64_to_jpeg( $base64_string, $output_file ) {
- $ifp = fopen( $output_file, "wb" );
- fwrite( $ifp, base64_decode( $base64_string) );
- fclose( $ifp );
- return( $output_file );
- }
- $facebook->setFileUploadSupport(true);
- $image = base64_to_jpeg( $your_base64_string, 'tmp.jpg' );
- $args = array('message' => 'Some message');
- $args['image'] = '@' . realpath( $image );
- $data = $facebook->api('/your_user_id/photos', 'post', $args);
- unlink($image);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement