The vc client uses the http post abc.txt file to send the post file to the php server. the abc.txt file received by the server is empty. Is it a php: // input problem. Thank you!
Vc client:
Content-Disposition: form-data; name = "upload"; filename = "abc.txt"
Content-Type: text/plain
Php server:
$ Input = file_get_contents ('php: // input ');
File_put_contents('abc.txt ', $ input );
?>
Reply to discussion (solution)
Use $ _ FILE to receive parameters.
To upload a file, use enctype = "multipart/form-data"
Php: // input does not accept such data, but the original post data (raw)
As you can see in the manual,
Php: // input is a read-only stream that can access the requested raw data. In the case of POST requests, it is best to use php: // input instead of $ HTTP_RAW_POST_DATA, because it does not rely on specific php. ini commands. In this case, $ HTTP_RAW_POST_DATA is not filled by default, which requires less memory than activating always_populate_raw_post_data. When enctype = "multipart/form-data", php: // input is invalid.
After checking the manual, php: // input is invalid when enctype = "multipart/form-data". use $ _ FILES. Thank you!