This may be a repeating question, but it is not: I get a few megabytes of data through php: / input (1-500mb), which I need to save to a file. More features (server load, speed) using:
file_put_contents($filename, file_get_contents('php://input'))
OR
$input = fopen("php://input", "r"); $temp = tmpfile(); $realSize = stream_copy_to_stream($input, $temp); fclose($input); $target = fopen($filename, "w"); fseek($temp, 0, SEEK_SET); stream_copy_to_stream($temp, $target); fclose($target);
source share