Post a Video to Facebook Page from c#
Can we post link and video at once to the Facebook fan page from c# code.
I have used the below code but it is only displaying the video. I need the
link below the video.
var client = new FacebookClient(accesstoken);
var media = new FacebookMediaObject { FileName = filename, ContentType =
type };
var path = Path.Combine(Server.MapPath("posts"), filename);
file.SaveAs(path);
byte[] img = System.IO.File.ReadAllBytes(path);
media.SetValue(img);
postparameters["source"] = media;
postparameters["message"] = txtmsg.Text;
postparameters["link"] = txtlink.Text;
client.Post("/206017329553602/videos", postparameters);
Please help. Thanks, Neer.
No comments:
Post a Comment