0

I have an iOS app that has a series of images in a scrollview (camera pictures). I want to be able to post these on to a url individually or collectively as a group.

Can someone point me to an example or some sample code that would get me started?

Much appreciated

Strong Like Bull
  • 11,155
  • 36
  • 98
  • 169

2 Answers2

3

in that case if you if you set up your server (how do this i don`t now, because i used quickblox - ready-made solution) try send GET-request to the server. You can try this like this: (source - How to send a Get request in iOS? )

 NSString *getString = [NSString stringWithFormat:@"parameter=%@",yourvalue];
 NSData *getData = [getString dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];

 NSString *getLength = [NSString stringWithFormat:@"%d", [getData length]];

 NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];

 [request setURL:[NSURL URLWithString:@"https:yoururl"]];

  [request setHTTPMethod:@"GET"];

  [request setValue:postLength forHTTPHeaderField:@"Content-Length"];

  [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];

  [request setHTTPBody:getData];

  self.urlConnection = [[[NSURLConnection alloc] initWithRequest:request delegate:self] autorelease];

  NSAssert(self.urlConnection != nil, @"Failure to create URL connection.");

  // show in the status bar that network activity is starting
  [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

For more advanced preferences I would advise you try learn http://allseeing-i.com/ASIHTTPRequest/

Community
  • 1
  • 1
frankWhite
  • 1,523
  • 15
  • 21
1

For this you can create file server or use other maded. Look this: http://quickblox.com/ - they has blobs and ios api for their server, so download|upload files simple implemented in code. First, you need register your account and then register your app.( https://admin.quickblox.com/signin ) (it's not difficult, few minuts) Then, using instructions from site added Quickblox auth to your app and then use QBBlobs for dowload photo. Good luck!

frankWhite
  • 1,523
  • 15
  • 21