I've been cracking my head over this and reading all the available docs I can find but still cannot find a solution, so I am posting here.
First, I started here, the official Facebook guide on posting a photo via the Graph API.
https://developers.facebook.com/blog/post/498/
Since it's in PHP, I rewrote it in ASP.NET C#. The code works in that the photo was upload successfully, and I got the JSON response with the photo's ID.
I need a way to read this ID back, so I suppose I'd have to do the upload from the server side. However, this would mean that the user will need to upload to my server first, and my code would then send this over to Facebook's API.
My question is: Is there a way to do this without first saving the file to the server's disk? Since at this point of time I'd have a data buffer of the file uploaded, can I somehow send this over to the Graph API? I find it rather redundant to first save the file and then upload again.
I thought of doing this using Javascript/AJAX but there doesn't seem to be a way either. Facebook's Javascript API does not provide for this.
I also tried to look at the various libraries such as this but the documentation is rather lacking. I also looked at this article but it assumes that I already have a file to upload.
Can the experts here post some sample code for doing this (if it's possible at all) or point me to the correct direction for what I needed. While we are on this, is there a way to trigger Facebook's photo upload dialog or do I have to build my own from scratch?
Thanks a lot in advance.
Ok, after some tinkering around I think I found the solution.
In the aspx
Codebehind (the authentication portion was converted from the sample PHP code given by Facebook.) No error handling yet
This appears to work but I still don't have details on what FacebookMediaObject and facebookClient() parameters are supposed to be. Does anyone know where I can get the full documentation for the Facebook C# SDK? Thanks!