在C中通过套接字发送二进制文件(从Windows到Linux)
我正在尝试使用 Polar ssl 通过套接字发送文件。客户端 (Windows) 将文件发送到服务器 (Linux),但当文件到达那里时,它已损坏。
有人知道我该如何解决这个问题吗?
发送:
fopen("file.zip","ab");//opening file
ssl_write()//sending file
接收:
fopen("file.zip","wb");//opening file
ssl_read()//getting file
I'm trying to send a file via socket using polar ssl. The client (Windows) sends the file to the server (Linux) but when the file gets there, it's corrupted.
Does anybody how can I solve that?
To send:
fopen("file.zip","ab");//opening file
ssl_write()//sending file
To receive:
fopen("file.zip","wb");//opening file
ssl_read()//getting file
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能与字节序有关?
Could be something to do with endianness?