Does PHP get the binary byte stream from C-sharp 's POST request?

problem description

the requirement is something like this: the C-sharp side of U3D will send a binary byte stream of a picture through POST to request my PHP interface, and then I get the byte stream and transfer it to the image and save it on the server.

The problem with

is that he returns data through the interface, which I can"t get. I can get the data by myself through PHP and CURL.

here is my PHP code to get the binary byte stream

/ / $byteStream = file_get_contents ("php://input");

Jul.03,2021

enctype= "multipart/form-data" when php://input is not available

if it is the above case, it is recommended to directly use $_ FILE ['XXX'] to get the uploaded file


From https://www.cnblogs.com/chenp.

summarize
1, use $_ POST
2 for multipart/form-data and application/x-www-form-urlencoded formats, and use file_get_contents ('php://input')

for example if application/json can't get it.
Menu