UploadedFile: getStream Example
Terry L edited this page Jun 20, 2020
·
2 revisions
Pages 111
Clone this wiki locally
Shieldon\Psr7\UploadedFile
getStream()
Retrieve a stream representing the uploaded file.
-
return
StreamInterface
Example:
$stream = new Stream(fopen(BOOTSTRAP_DIR . '/sample/shieldon_logo.png', 'r+'));
$uploadedFile = new UploadedFile($stream);
$stream2 = $uploadedFile->getStream();
echo $stream2->getMetadata('mode');
// Outputs: r+
Install
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.