Search code examples
c#asp.netfacebookphoto

Facebook album creation and photo upload


I am a beginner when it comes to Facebook Development.

I am using ASP.NET and the C# Facebook sdk I need to create a photo album in a users personal Facebook profile. Before the new album is created the webapp should iterate through the users existing albums (by album name) to establish whether or not the album already exists. If the album exists, the Album id should be returned and A picture/photo should be uploaded to that album. Otherwise the album should be created and the photo should be posted to the newly created album.

I have searched the net but I could not find a helping asp.net sample or any source articles. I have however found winforms samples for C# but it was not of much help as the web sdk and the winforms sdk seem to be quite different from each other.

I have downloaded the C# SDKs for Facebook web development and referenced them in my project but I can't seem to figure out exactly how to get the job done.

PS. My Facebook application is already created and functioning.


Solution

  • First you should look at Facebook Developer Kit.

    And also i found these question Get Photos From Album Facebook C#sdk with this code;

    //Get the album data
    dynamic albums = app.Get("me/albums");
    foreach(dynamic albumInfo in albums.data)
    {
       //Get the Pictures inside the album this gives JASON objects list that has photo attributes 
       // described here http://developers.facebook.com/docs/reference/api/photo/
       dynamic albumsPhotos = app.Get(albumInfo.id +"/photos");
    }
    

    Finally, you should look these articles;

    Using Facebook SDK 3.01 with C#.NET

    Facebook C# SDK Upload Photos with Tagging

    “Facebooksdk” – C#.NET Library For Facebook API