Home  >  Article  >  Backend Development  >  php receives binary stream, php receives binary_PHP tutorial

php receives binary stream, php receives binary_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:44:28995browse

php receives binary stream, php receives binary

/**Binary stream generated file
* $_POST cannot interpret binary stream, you need to use $GLOBALS['HTTP_RAW_POST_DATA'] or php://input
* Neither $GLOBALS['HTTP_RAW_POST_DATA'] nor php://input can be used Used for enctype=multipart/form-data
* @param String $file The file path to be generated
* @return boolean
*/
function binary_to_file($file){
$content = $GLOBALS[ 'HTTP_RAW_POST_DATA']; // php.ini settings are required
if(empty($content)){
$content = file_get_contents('php://input'); // php.ini settings are not required, Low memory pressure
}
);



http://www.bkjia.com/PHPjc/1048765.html

www.bkjia.com

http: //www.bkjia.com/PHPjc/1048765.htmlTechArticlephp receives binary stream, php receives binary/** Binary stream generated file* $_POST cannot interpret binary stream, required Use $GLOBALS['HTTP_RAW_POST_DATA'] or php://input * $GLOBALS['...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn