Это должно сделать это.
function chunked_copy($from, $to) {
# 1 meg at a time, you can adjust this.
$buffer_size = 1048576;
$ret = 0;
$fin = fopen($from, "rb");
$fout = fopen($to, "w");
while(!feof($fin)) {
$ret += fwrite($fout, fread($fin, $buffer_size));
}
fclose($fin);
fclose($fout);
return $ret; # return number of bytes written
}