PHP://输入返回空字符串 [英] php://input returning empty string
问题描述
以下code最近开始返回空字符串。它适用于其他系统,所以它不会出现以与code本身的问题。我从字面上消除了所有的服务器端code,而且它还是做同样的事情。我也尝试使用的file_get_contents无济于事,只是种拍摄在黑暗中。
$ FILESTREAM =的fopen('PHP://输入,RB);$ FILEDATA ='';
而($缓冲= FREAD($ FILESTREAM,4096)){
$ FILEDATA = $缓冲区。
}
服务器: Zend服务器5.1.0(Apache的2.2.3)
语言: PHP 5.3.5
前端: Plupload(JavaScript的插件)
PHP://输入
无法打开/读取时
接收的multipart / form-data的
POST,
也许这就是改变
客户端片面? - Wrikken 03月28日在
20:01
块引用>感谢您的帮助!
The following code recently started returning empty strings. It works on other systems, so it doesn't appear to be a problem with the code itself. I literally eliminated all of the server-side code, and it still did the same thing. I also tried using file_get_contents to no avail, just kind of shooting in the dark.
$fileStream = fopen('php://input', 'rb'); $fileData = ''; while ($buffer = fread($fileStream, 4096)) { $fileData .= $buffer; }
Server: Zend Server 5.1.0 (Apache 2.2.3)
Language: PHP 5.3.5
Front-End: Plupload (JavaScript plugin)
解决方案
php://input
cannot be opened/read when receiving amultipart/form-data
POST, maybe that's what changed client-sided? – Wrikken Mar 28 at 20:01Thanks for your help!
这篇关于PHP://输入返回空字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!