0) { $length = min($rest_size, 4 * 1024); if (fwrite($file, random_bytes($length)) == false) { return false; } $rest_size -= $length; } } else if ($size > 0) { fseek($file, $size - 1); fwrite($file, ' '); } fclose($file); return $fileName; }