开发者

recieve file send by client socket using PHP sever socket [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 4 years ago.

开发者_StackOverflow社区 Improve this question

I want to save file send by client using PHP server socket. I am newbie to PHP socket programming.

Does anyone know possible options?

-SAM


Have look at this snippet, it recieves a file sent to the php socket server then saves it on the server:

http://www.example-code.com/php/socket_receiveFile.asp

Alternatively you could develop your own solution, but then you'd have to:

  • Create a binary structure for what each request looks like. For example you need to create predefined header that the server can read to know what type of request it is, what type of data it is, where the data starts in the file and what to do with the data.
  • Create a binary parser which will read the header and which can take the binary data and turn it into a file and then save it.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜