i uploaded the image to my server using Base64 string. but its was taken more time to upload on server. i will give the code below. please help.
NSString *locationOfWebService = @"my url";
NSString *urlString = [NSString stringWithFormat:@"%@updateUserProfile",locationOfWebService];
NSLog(@"image--%@",chosenImage);
NSData* data = UIImageJPEGRepresentation(chosenImage, 1.0f);
NSString *strEncoded = [Base64 encode:data];
// NSString * requestBody= [NSString stringWithFormat:@"userid=%@&tokenid=%@&password=%@&image=%@&username=%@&phone=%@&country=%@&statusmessage=%@¬ificationstatus=%@&countryid=%@&apptID=%@&address=%@&city=%@&state=%@&zipcode=%@",appdel.usrId,@"",txtPass.text,strEncoded,txtName.text,@"",txtCountry.text,StatusLabale.text,@"false",@"1",txtApartNo.text,txtAddress.text,txtCity.text,txtState.text,txtZipcode.text];
NSString * requestBody= [NSString stringWithFormat:@"userid=%@&tokenid=%@&password=%@&image=%@&username=%@&phone=%@&country=%@&statusmessage=%@¬ificationstatus=%@&countryid=%@&apptID=%@&address=%@&city=%@&state=%@&zipcode=%@",appdel.usrId,token,@"",strEncoded,@"",@"",@"",@"",@"false",@"1",@"",@"",@"",@"",@""];
NSLog(@"string----%@",requestBody);
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init] ;
[request setURL:[NSURL URLWithString:urlString]];
[request setHTTPMethod:@"POST"];
[request setHTTPBody: [requestBody dataUsingEncoding:NSUTF8StringEncoding]];
NSURLConnection *connect=[[NSURLConnection alloc]initWithRequest:request delegate:self];
if (connect){
webData = [[NSMutableData alloc]init];
}
else
{
}