Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4259696
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:49:11+00:00 2026-05-21T05:49:11+00:00

i am integrating facebook with my iphone application. i can share text message in

  • 0

i am integrating facebook with my iphone application. i can share
text message in facebook, but i want to share/ upload
photos to facebook through my iphone application.
please let me know is there soution for this.
i am trying the facebook sample code but it is giving me some
errors: i searched out that error but other developer also
facing this type of error. please let me know if there is
some one who did upload/ share a photo on facebook in iphone
application.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T05:49:12+00:00Added an answer on May 21, 2026 at 5:49 am

    you need to create an album for uploading images,after u have created an album via facebook api you have to use its id to upload photos

    // for making a facebook album u have to make a multi-part form request
    //to this url https://graph.facebook.com/100002232753228/albums
    //where 100002232753228 is the fbid of the user and with form fields access_token,name,message, for reference go to -http://developers.facebook.com/docs/reference/api/album/
    
    //To upload a foto to album send multi-part data to the url - https://graph.facebook.com/102657189818706/photos
    
    //where 102657189818706 is the facebook id of the album created
    

    Here is the code

    #define kRequestBoundary @"----FOO"
    
        NSMutableData *postBody = [[NSMutableData alloc] init]; 
        [postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", kRequestBoundary] dataUsingEncoding:NSUTF8StringEncoding]]; //starting the boundary of form data
    
                            [postBody appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"access_token\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; //setting field name of access_toke 
                            [postBody appendData:[[NSString stringWithString:@"200726069952695|fd9c7d8ed4b5592b1240cdb3-100002232753228|i7ae5By6VFItLliVT1jw5jsETEY"] dataUsingEncoding:NSUTF8StringEncoding]];
        //setting field value of access_token
    
        [postBody appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", kRequestBoundary] dataUsingEncoding:NSUTF8StringEncoding]]; //closing the boundary for next field
    
        [postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"image\"; filename=\"UserImage.png\"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
    //setting the field name of image
    
        [postBody appendData:[[NSString stringWithString:@"Content-Type: image/png\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; //setting the content-Type of image
    
    
    
            UIImage *cropped=[UIImage imageNamed:@"Sample.png"];
    
    
    
        NSData *pImageData = UIImagePNGRepresentation(cropped);
    
    
        [postBody appendData:pImageData]; // adding image data to the request data
    
        [postBody appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",kRequestBoundary] dataUsingEncoding:NSUTF8StringEncoding]]; //closing the 
    
    
        NSString *urlString = @"https://graph.facebook.com/102657189818706/photos";
    
    
        NSMutableURLRequest *request=[[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:pUrl]];
        self.mURLrequest=request;
        [request release];
        [pUrl release];
        [request setHTTPMethod:@"POST"];
    
        NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", kRequestBoundary];
    
        [request setValue:contentType forHTTPHeaderField:@"Content-type"];
        [mURLrequest setHTTPBody:postBody];
    
    
        NSURLConnection *temp=[[NSURLConnection alloc] initWithRequest:mURLrequest delegate:self];
    [temp autorelease];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to the facebook c# SDK, want to get started but I'm
I am using facebook sdk and facebook connect for integrating fb into my site
I want users to be able to use Facebook Connect on MY website. And
learning Jquery and integrating with PHP - getting there, but have one last challenge
I'm looking at integrating a wizard in an existing Spring 3 MVC+JPA+Jquery+JSP application. I
I am integrating FlurryAPI with my app, and I don't want it to start
I know there are a lot of questions out there for facebook integration, and
I have a problem integrating GWT into OSGi Equinox container. The entry point webpage
I'm fairly new to iOS development, and I'm starting work on an App that
I am facing an error trying to configure omniauth for integration testing purpose with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.