Look at this snippet, it receives the file sent to the php socket server, and then saves it on the server:
http://www.example-code.com/php/socket_receiveFile.asp
Alternatively, you can develop your own solution, but then you have to:
- Create a binary structure for each query. For example, you need to create a predefined header that the server can read to know what type of request it is, what data type it has, where the data starts in the file, and what to do with the data.
- Create a binary parser that will read the header and which can take binary data and turn it into a file and then save it.
source share