Skip to content

UploadedFile: getStream Example

Terry L edited this page Jun 20, 2020 · 2 revisions

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+
Clone this wiki locally