recieve file send by client socket using PHP sever socket [closed]
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 questionI 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.
精彩评论