Php receives binary streams, and php receives binary streams. Php receives binary streams. php receives binary ** binary stream generated files * $ _ POST. binary streams cannot be interpreted. you need to use $ GLOBALS [HTTP_RAW_POST_DATA] or php: input * $ GLOBALS [php receives binary streams, and php receives binary streams
/** Generate a binary stream file
* $ _ POST cannot interpret binary streams. $ GLOBALS ['http _ RAW_POST_DATA '] or php: // input
* $ GLOBALS ['http _ RAW_POST_DATA '] and php: // input cannot be used for enctype = multipart/form-data
* @ Param String $ file: Path of the file to be generated
* @ Return boolean
*/
Function binary_to_file ($ file ){
$ Content = $ GLOBALS ['http _ RAW_POST_DATA ']; // php. ini is required.
If (empty ($ content )){
$ Content = file_get_contents ('php: // input'); // You do not need to set php. ini. the memory pressure is low.
}
$ Ret = file_put_contents ($ file, $ content, true );
Return $ ret;
}
Binary_to_file ('photo/test.png ');
Pipeline/** binary stream generation file * $ _ POST cannot interpret binary streams. you need to use $ GLOBALS ['http _ RAW_POST_DATA '] or php: // input * $ GLOBALS ['...