getSize()) { return false; } $target = fopen($path, "w"); fseek($temp, 0, SEEK_SET); stream_copy_to_stream($temp, $target); fclose($target); return true; } public function getName() { return $_GET['qqfile']; } public function getSize() { if (isset($_SERVER["CONTENT_LENGTH"])) { return (int)$_SERVER["CONTENT_LENGTH"]; } else { throw new \Exception('Getting content length is not supported.'); } } } // __END__