$stream
$size
$error
$clientFilename
$clientMediaType
Create a new uploaded file. If a size is not provided it will be determined by checking the size of the stream.
StreamInterface
*
int|null
= null
int
= 0
string|null
UploadedFileInterface
Example:
$uploadedFileFactory = new UploadedFileFactory(); $sourcePath = BOOTSTRAP_DIR . '/sample/shieldon_logo.png'; $targetPath = STORAGE_DIR . '/images/shieldon_logo.png'; $streamFactory = new StreamFactory(); $uploadedFileFactory = new UploadedFileFactory(); $stream = $streamFactory->createStreamFromFile($sourcePath); $uploadedFile = $uploadedFileFactory->createUploadedFile($stream); // Move file from $sourcePath to $targetPath. $uploadedFile->moveTo($targetPath);
There was an error while loading. Please reload this page.