I'm using a upload script with ajax and PHP and it works wonders for files smaller than 80MB. However, if the file is bigger than 80MB it fails, it doesn't even output anything at all.
The code is:
$maxsize = getMaxFileSize();
$finalfile = $uploadpath . $finalname;
$putdata = fopen("php://input", "r");
$fp = fopen($finalfile, "w");
$filesizecalc = 0;
while ($data = fread($putdata, 1024)) {
fwrite($fp, $data);
$filesizecalc = $filesizecalc + 1024;
}
fclose($fp);
fclose($putdata);
if ($filesizecalc <= $maxsize) {
addFile($_SESSION['userdata']['userid'], $finalname);
echo "$fn uploaded";
} else {
unlink($finalfile);
}
exit();
This works fine with almost all files < 80 MB, but for files bigger than 80MB it doesn't output a thing, so I don't even know what's going wrong, even though I set
error_reporting(E_ALL | E_NOTICE);
ini_set('display_errors', 1);
ini_set('memory_limit', '1024M');
ini_set('upload_max_filesize', '1024M');
ini_set('post_max_size', '1024M');
ini_set('max_input_time', 10000);
ini_set('max_execution_time', 10000);