0

I am able to upload video from the code below. But the video isn't PRIVATE. I need video to be PRIVATE or in other words it should be SELF.

FacebookMediaObject mediaObject1 = new FacebookMediaObject
{
FileName = pbmFile.fullPath,
ContentType = Path.GetExtension(filePath)
};
byte[] fileBytes1 = System.IO.File.ReadAllBytes(filePath);
mediaObject1.SetValue(fileBytes1);
IDictionary<string, object> upload1 = new Dictionary<string, object>();
upload1.Add("image", mediaObject1);

staticGlobalConst.fbClient1.Post("/me/videos", upload1, staticGlobalConst.del1Video) as JsonObject

When I add the code below it throws exception

I tried adding parameter

upload1.Add("privacy", "SELF");

How can I upload a private video?

Thanks Sujit

sujit
  • 135
  • 8

2 Answers2

1

I solved it by adding below parameter

upload1.Add("privacy", "{\"value\":\"SELF\"}");
sujit
  • 135
  • 8
0

that is depends on what was your choice for " Visibility of app and posts: " option when the first time you authenticated with the app.

you can change it to : Public,Friends,Only Me , from your Account Settings>Apps and choose your application and change it .

Eslam Hamouda
  • 1,141
  • 9
  • 13
  • 1
    Thanks Eslam. I can't use your solution, as I can't ask the user to change his/ her settings. I solved it by adding below parameter upload1.Add("privacy", "{\"value\":\"SELF\"}"); – sujit Feb 25 '13 at 07:07