Zend\Diactoros\UploadedFile::writeFile PHP Method

writeFile() private method

Write internal stream to given path
private writeFile ( string $path )
$path string
    private function writeFile($path)
    {
        $handle = fopen($path, 'wb+');
        if (false === $handle) {
            throw new RuntimeException('Unable to write to designated path');
        }
        $stream = $this->getStream();
        $stream->rewind();
        while (!$stream->eof()) {
            fwrite($handle, $stream->read(4096));
        }
        fclose($handle);
    }