I'm using the Valums File Uploader to upload files using XHR. The script I use works great on my live server while it fails on my local server. The code concerned is following:
$input = fopen("php://input", "r");
$temp = tmpfile();
$realSize = stream_copy_to_stream($input, $temp);
fclose($input);
if ($realSize != $this->getSize()){
return false;
}
$target = fopen($path, "w");
fseek($temp, 0, SEEK_SET);
stream_copy_to_stream($temp, $target);
fclose($target);
chmod($path, 0644);
The thing is that $realSize is empty on my local server while it does have a value on my live server. So on the local server it breaks at the size check. I suspect it is a server configuration issue, but I don't exactly know what to look for. Could someone point me into the right direction?