Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>NSString *urlstring=[appDelegate.SmartAutoString stringByAppendingPathComponent:[NSString stringWithFormat:@"smartautoXml.php"]]; NSURL *nsurl =[NSURL URLWithString:urlstring]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; [request setURL:nsurl]; [request setHTTPMethod:@"POST"]; NSString *boundary = @"---------------------------14737809831466499882746641449"; NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary]; [request addValue:contentType forHTTPHeaderField: @"Content-Type"]; NSMutableData *body = [NSMutableData data]; if (dataImage) { NSLog(@"imageCounter %i",imageCounter); [body appendData:[[NSString stringWithFormat: @"Content-Disposition: form-data; name=\"imgAryId\"\r\n\r\n%i", imageCounter] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; img22=[UIImage imageWithData:dataImage]; NSLog(@"dataImage %@ %@",dataImage,img22); NSString *temp=[NSString stringWithFormat: @"Content-Disposition: form-data; name=\"img\"; "filename=\"image%i.jpg\"\r\n",imageCounter]; [body appendData:[[NSString stringWithString:temp] dataUsingEncoding:NSUTF8StringEncoding]]; NSLog(@"temp %@",temp); // [body appendData:[@"Content-Disposition: form-data; name=\"image\"; // "filename=\"image0.jpg\"\r\n" //dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[NSData dataWithData:dataImage]]; [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload