开发者

File upload in iphone

开发者 https://www.devze.com 2023-01-02 03:55 出处:网络
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

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

精彩评论

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