开发者

File upload in iphone

I am developing an iphone application which needs to upload some image files to server.The images needs to be uploaded as binary data.I converted the image to NSData using [NS开发者_运维知识库Data dataWithContentsOfFile:filepath];

But i dont know how to convert this NSData to Binary data.Looking for a solution

Thanks,


Try base64 encoding of the binary data. Convert your NSData object to base 64 using QSStrings. See this question


I recommend that you use ASIHTTPRequest

Read the How-to-use section http://allseeing-i.com/ASIHTTPRequest/How-to-use There are some examples of sending files and NSData

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜