开发者

Sending an image data over a socket, but it receives of some different format when it reaches server

I am cre开发者_如何学运维ate a NSData file from the image and sending over server using socket.

CFWriteStreamWrite(myWriteStream, (const UInt8 *)data, [data length]);

But the server receives it in different format. and unable to open file.


What's the type of 'data' in your code snippet?

If it was a (NSData *) object, you should write like:

CFWriteStreamWrite(myWriteStream, (const UInt8 *)[data bytes], [data length]);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜