将带有说明和操作链接的视频文件上传到 Facebook

本文关键字:文件 Facebook 的视频 链接 说明 操作 | 更新日期: 2023-09-27 18:33:44

在C#中,我使用以下方法将视频文件从服务器上传到Facebook:

        string fullurl = "https://graph-video.facebook.com/me/videos?" + "title=" + title + "&access_token=" + accessToken;
        WebClient client = new WebClient();
        byte[] returnBytes = client.UploadFile(fullurl, path);
路径

是服务器上视频文件的路径。这有效,并在用户个人资料上显示上传的视频帖子。如何向该帖子添加文本描述(带链接)和操作链接?

请保留 C# 中的答案

将带有说明和操作链接的视频文件上传到 Facebook

您应该使用嵌入式URL传递额外的查询字符串参数 - 描述。像这样:

var description = "Bring your conversations to life on Facebook. With face-to-face video calling, now you can watch your friends smile, wink and LOL.'n'nTo get started, visit http://www.facebook.com/videocalling"; 
string fullurl = string.Format("https://graph-video.facebook.com/me/videos?title={0}&description={1}&access_token={2}", HttpUtility.UrlEncode(title), HttpUtility.UrlEncode(description ), accessToken);

我做到了。以下是我的代码:

string a = "User_Access_Token";
string fullurl = string.Format("https://graph-video.facebook.com/me/videos?title={0}&description={1}&access_token={2}", HttpUtility.UrlEncode("Dulha"), HttpUtility.UrlEncode("hello"), a);
WebClient client = new WebClient();
byte[] returnBytes = client.UploadFile(fullurl, @"C:'Users'Users'Downloads'Dulha.mp4");