private function UploadedFile::writeFile in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/zendframework/zend-diactoros/src/UploadedFile.php \Zend\Diactoros\UploadedFile::writeFile()
Write internal stream to given path
Parameters
string $path:
1 call to UploadedFile::writeFile()
- UploadedFile::moveTo in vendor/
zendframework/ zend-diactoros/ src/ UploadedFile.php
File
- vendor/
zendframework/ zend-diactoros/ src/ UploadedFile.php, line 219
Class
Namespace
Zend\DiactorosCode
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);
}