使用以下行将视频上传到 Facebook。
$video = "http://xxx.com/video.mp4";
$data = array('name' => 'file', 'file' => $video,
'access_token' => $access_token, '_title' => $video_title,
'description' => $video_desc);
$post_url = "https://graph-video.facebook.com/" . $page_id . "/videos";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $post_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$res = curl_exec($ch);
我收到一个错误:
"error":{"message":"(#353) You must select a video file to
upload.","type":"OAuthException","code":353}}
如果我更改curl
为表单帖子,它会起作用。关于为什么会这样的任何想法?