-
Notifications
You must be signed in to change notification settings - Fork 1
UploadedFile: __construct Example
Terry L edited this page Jun 20, 2020
·
2 revisions
Shieldon\Psr7\UploadedFile
-
param
string|StreamInterface
source*
The full path of a file or stream. -
param
string|null
name= null
The file name. -
param
string|null
type= null
The file media type. -
param
int|null
size= null
The file size in bytes. -
param
int
error= 0
The status code of the upload. -
param
string|null
sapi= null
Only assign for unit testing purpose.
Example:
$uploadedFile = new \Shieldon\Psr7\UploadedFile(
'/tmp/php200A.tmp', // source
'example1.jpg', // name
'image/jpeg', // type
100000, // size
0 // error
);
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.