我在我的开发机器上遇到了一个问题,这台机器看起来很孤立,我无法弄明白.我有一个jQuery文件上传器,它将用户选择的文件发布到PHP脚本,以便使用XmlHttpRequest进行处理.该脚本在运行OSX10.6.3和MacAMP 1.9的MacBook Pro上工作正常,但是在我的iMac上使用完全相同的操作系统和MAMP版本,具有相同的服务器映像,它失败了.
我已经将错误的原因追溯到$_SERVER["CONTENT_LENGTH"]返回0, even though I can get the filename just fine and everything else seems to have succeeded about the request. For some reason it just won't seem to give me the actual content length. Here is the code that is causing the problem - the function in question is getSize().
class qqUploadedFileXhr {
/**
* Save the file to the specified path
* @return boolean TRUE on success
*/
function save($path) {
$input …Run Code Online (Sandbox Code Playgroud)