0

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 [NSData dataWithContentsOfFile:filepath];

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

Thanks,

MobX
  • 2,578
  • 6
  • 31
  • 53

2 Answers2

0

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

Community
  • 1
  • 1
primulaveris
  • 946
  • 14
  • 20
0

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

epatel
  • 45,445
  • 17
  • 107
  • 143