Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>// add image data NSData *imageData = UIImageJPEGRepresentation(imageToPost, 1.0); if (imageData) { [body appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"; filename=\"image.jpg\"\r\n", FileParamConstant] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithString:@"Content-Type: image/jpeg\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:imageData]; [body appendData:[[NSString stringWithFormat:@"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; } </code></pre> <p>Follow this answer <a href="https://stackoverflow.com/questions/8042360/nsdata-and-uploading-images-via-post-in-ios">Link</a> </p> <p>Or you can use ASIHTTP classes for this </p> <pre><code>ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"http://URL/Service.asmx/RegisterClient?"]]; request.delegate=self; encodedImage = UIImagePNGRepresentation(imgRef); [[NSUserDefaults standardUserDefaults]setObject:UIImagePNGRepresentation(imgRef) forKey:@"userImage"]; str =[Base64 encode:encodedImage]; [request setPostValue:email.text forKey:@"Email"]; [request setPostValue:name.text forKey:@"FName"]; [request setPostValue:str forKey:@"UserImage"]; [request setPostValue:dob.text forKey:@"dob"]; [request setPostValue:phoneNumber.text forKey:@"Phone"]; [request setPostValue:ggg.text forKey:@"Gender"]; [request setPostValue:address.text forKey:@"Address"]; [request setPostValue:interest.text forKey:@"Interest"]; [request startAsynchronous]; </code></pre> <p><a href="http://allseeing-i.com/ASIHTTPRequest/" rel="nofollow noreferrer"> ASIHTTPRequest documentation</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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