0
我使用下面的代码上传影片到用户墙:视频上传到Facebook的使用图形API
if(isset($_POST['submitVideo'])) {
$img = $_FILES['source']['name'];
$ret_obj = $facebook->api('/me/videos', 'POST', array(
'source' => '@' . $img,
'title' => "This is just a test",
'description' => 'test9000',
'privacy' => json_encode(array('value' => 'EVERYONE')),
)
);
echo '<pre>Video ID: ' . $ret_obj['id'] . '</pre>';
}
的形式如下:
<form target="uploadTarget" enctype="multipart/form-data" method="POST">
<input name="source" type="file">
<input type="submit" value="Upload" name="submitVideo" />
</form>
我的问题是与源图像。难道是正确的使用:
$img = $_FILES['source']['name'];
应该是什么源?我正在从本地计算机上传文件。
编辑:
如果我用同样的形式下面的模式,并使用这个“$ POST_URL”为行动:
$post_url = "https://graph-video.facebook.com/me/videos?"
. "title=" . $video_title. "&description=" . $video_desc
. "&access_token=". $access_token;
它的工作原理。但是转到这个“$ post_url”页面,它显示了上传文件的ID。我怎样才能使用该ID放入我的数据库?
我编辑了我的问题。请看一看。谢谢 –