How do I attach an image to an XML file in Objective-C to POST to a WebService?
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<SaveRequest>
<PictureDataFile></PictureDataFile>
<PictureDataName>sample</PictureDataName>
</SaveRequest>
How do I append the image data into 'PictureDataFile'?
And in my objective-C I have,
NSString *post = [self loadFileName:@"SaveRequest" ofType:@"xml"];
//loads the xml into a string
NSMutableData *postData = [[post dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES] mutableCopy];
[postData appendData:paramBuilder.imageData];
//paraBuilder.imageData contains a UIImage in NSData
I can see the server receive the request, but no image data is received. Thanks for any help in advance.