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 800445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:17:35+00:00 2026-05-14T23:17:35+00:00

So I have an iPhone application that needs to: Post several strings and up

  • 0

So I have an iPhone application that needs to:

  1. Post several strings and up to 5 images (stored in memory) to a RoR web application
  2. Parse the JSON returned that will include several strings and an array of URLs (each representing the location of where the uploaded images can be found on the website).

QUESTIONS:

  1. Can this be done with Three20 (would be nice since I’m using it for other things)? And if so, how?

  2. If it can’t be done with Three20 … how would it be accomplished using ASIHttpRequest? Or maybe something baked into the SDK if that is a better option?

Thanks much

  • 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-14T23:17:35+00:00Added an answer on May 14, 2026 at 11:17 pm

    Unfortunately there isn’t a whole lot of tutorials and good documentation for three20 out there on the web … so here is how I finally got things working:

    - (void) sendToWebsite {
    
        NSString* url = [[NSString stringWithFormat:kRequestURLPath, self.entityId] stringByAppendingString:@".json"] ;
    
        // Prep. the request
        TTURLRequest* request = [TTURLRequest requestWithURL: url delegate: self];
        request.httpMethod = @"POST";
        request.cachePolicy = TTURLRequestCachePolicyNoCache; 
    
        // Response will be JSON ... BUT WHY DO I NEED TO DO THIS HERE???
        request.response = [[[TTURLJSONResponse alloc] init] autorelease];
    
        // Set a header value
        [request setValue:[[UIDevice currentDevice] uniqueIdentifier] forHTTPHeaderField:@"Device-UID"];
    
        // Post a string
        [request.parameters setObject:self.entity_title forKey:@"entity_title"];
    
        // Post some images
            for (int i = 0; i < [self.photos count]; i++) {
            // IS IT POSSIBLE TO ADD A PARAM NAME SO I CAN LOOK FOR THE SAME NAME
            // IN THE WEB APPLICATION REGARDLESS OF FILENAME???
            [request addFile:UIImagePNGRepresentation([self.winnerImages objectAtIndex:i]) 
                    mimeType:@"image/png" 
                    fileName:[NSString stringWithFormat:@"photo_%i.png", i]];
        }
    
            // You rails guys will know what this is for
            [request.parameters setObject:@"put" forKey:@"_method"];
    
            // Send the request
        [request sendSynchronously];
    
    }
    

    Things I still don’t understand (or find problematic):

    1. For a posted file, how can I include both a param name AND a filename?
    2. What is the purpose of setting request.response = to whatever? I don’t get that.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone application that uploads images directly to S3. Then it hits
I have an iPhone application that needs to be updated as soon as a
I have an iPhone application that needs to sort a couple of NSMutableArrays, this
I am working on an iphone application that needs to send some images over
I have some resources (zipped) that needs to be shipped with my iphone application.
I am new to iphone application development. I have a sample application that needs
I have an iPhone application that needs to save an image onto the database
I have an iPhone application that adds new contacts via the Address Book Framework.
I have an iPhone application that reads RSS feeds from a YouTube channel. However,
I have an iPhone application that send datas via wifi on my mac. I

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.