如何使用iphone sdk通过Web服务发送附件?

如何使用iphone sdk通过Web服务发送附件?,iphone,web-services,ios4,attachment,Iphone,Web Services,Ios4,Attachment,在我的应用程序中,我必须发送文件音频、图像、文本和视频等。。使用webservice访问服务器。 在这里,我使用Base64二进制字符串向应用程序发送字节。但这里的数据被破坏了。是否有任何方法可以将base64binary发送到服务 或者是否有任何方法将附件发送到服务或将文件复制到服务器 任何人都可以帮助我 提前谢谢 -NSMutableURLRequest*保存附件:NSData*数据名称:NSString*名称文件类型:NSString*类型{ [self setUserCredential

在我的应用程序中,我必须发送文件音频、图像、文本和视频等。。使用webservice访问服务器。 在这里,我使用Base64二进制字符串向应用程序发送字节。但这里的数据被破坏了。是否有任何方法可以将base64binary发送到服务

或者是否有任何方法将附件发送到服务或将文件复制到服务器

任何人都可以帮助我

提前谢谢

-NSMutableURLRequest*保存附件:NSData*数据名称:NSString*名称文件类型:NSString*类型{

[self setUserCredentials];

NSString *strsdf = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSString *sdf=@"lll.jpg";
NSString *strt = [Base64 encode:data];
//NSLog(@"strt %@",strt);

NSString *soapMsg = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\
                     <soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\">\
                     <soap12:Body>\
                     <InsertAttachmentint xmlns=\"http://tempuri.org/\">\
                     <Filename>%@</Filename>\
                     <FileType>%@</FileType>\
                     <FileContentint>%@</FileContentint>\
                     </InsertAttachmentint>\
                     </soap12:Body>\
                     </soap12:Envelope>",sdf,type,strsdf];
这是代码。 这里strsdf是二进制的

我会在


此包装器使使用iOS发送和接收数据变得更加容易。

请显示您尝试过的代码片段。