Receiving file sending by client socket via PHP sever socket

I want to keep sending a file by the client using a PHP server. I am new to PHP socket programming.

Does anyone know the possible options?

-SAM

+4
source share
1 answer

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.
0
source

All Articles