ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | ||||||
__construct ( $streamOrFile, $size, $errorStatus, $clientFilename=null, $clientMediaType=null) | ||||||
isMoved () | ||||||
getStream () | ||||||
{Retrieve a stream representing the uploaded file.This method MUST return a StreamInterface instance, representing the uploaded file. The purpose of this method is to allow utilizing native PHP stream functionality to manipulate the file upload, such as stream_copy_to_stream() (though the result will need to be decorated in a native PHP stream wrapper to work with such functions).If the moveTo() method has been called previously, this method MUST raise an exception.
| ||||||
moveTo ($targetPath) | ||||||
{Move the uploaded file to a new location.Use this method as an alternative to move_uploaded_file(). This method is guaranteed to work in both SAPI and non-SAPI environments. Implementations must determine which environment they are in, and use the appropriate method (move_uploaded_file(), rename(), or a stream operation) to perform the operation.$targetPath may be an absolute path, or a relative path. If it is a relative path, resolution should be the same as used by PHP's rename() function.The original file or stream MUST be removed on completion.If this method is called more than once, any subsequent calls MUST raise an exception.When used in an SAPI environment where $_FILES is populated, when writing files via moveTo(), is_uploaded_file() and move_uploaded_file() SHOULD be used to ensure permissions and upload status are verified correctly.If you wish to move to a stream, use getStream(), as SAPI operations cannot guarantee writing to stream destinations.
| ||||||
getSize () | ||||||
{Retrieve the file size.Implementations SHOULD return the value stored in the "size" key of the file in the $_FILES array if available, as PHP calculates this based on the actual size transmitted.
| ||||||
getError () | ||||||
{Retrieve the error associated with the uploaded file.The return value MUST be one of PHP's UPLOAD_ERR_XXX constants.If the file was uploaded successfully, this method MUST return UPLOAD_ERR_OK.Implementations SHOULD return the value stored in the "error" key of the file in the $_FILES array.
| ||||||
getClientFilename () | ||||||
{Retrieve the filename sent by the client.Do not trust the value returned by this method. A client could send a malicious filename with the intention to corrupt or hack your application.Implementations SHOULD return the value stored in the "name" key of the file in the $_FILES array.
| ||||||
getClientMediaType () | ||||||
{Retrieve the media type sent by the client.Do not trust the value returned by this method. A client could send a malicious media type with the intention to corrupt or hack your application.Implementations SHOULD return the value stored in the "type" key of the file in the $_FILES array.
| ||||||
Private Member Functions | |
setStreamOrFile ($streamOrFile) | |
Depending on the value set file or stream variable. More... | |
setError ($error) | |
setSize ($size) | |
isStringOrNull ($param) | |
isStringNotEmpty ($param) | |
setClientFilename ($clientFilename) | |
setClientMediaType ($clientMediaType) | |
isOk () | |
Return true if there is no upload error. More... | |
validateActive () | |
Private Attributes | |
$clientFilename | |
$clientMediaType | |
$error | |
$file | |
$moved = false | |
$size | |
$stream | |
Static Private Attributes | |
static | $errors |
Definition at line 9 of file UploadedFile.php.
GuzzleHttp\Psr7\UploadedFile::__construct | ( | $streamOrFile, | |
$size, | |||
$errorStatus, | |||
$clientFilename = null , |
|||
$clientMediaType = null |
|||
) |
StreamInterface | string | resource | $streamOrFile | |
int | $size | |
int | $errorStatus | |
string | null | $clientFilename | |
string | null | $clientMediaType |
Definition at line 67 of file UploadedFile.php.
References GuzzleHttp\Psr7\UploadedFile\$clientFilename, GuzzleHttp\Psr7\UploadedFile\$clientMediaType, GuzzleHttp\Psr7\UploadedFile\$size, GuzzleHttp\Psr7\UploadedFile\isOk(), GuzzleHttp\Psr7\UploadedFile\setClientFilename(), GuzzleHttp\Psr7\UploadedFile\setClientMediaType(), GuzzleHttp\Psr7\UploadedFile\setError(), GuzzleHttp\Psr7\UploadedFile\setSize(), and GuzzleHttp\Psr7\UploadedFile\setStreamOrFile().
GuzzleHttp\Psr7\UploadedFile::getClientFilename | ( | ) |
{Retrieve the filename sent by the client.Do not trust the value returned by this method. A client could send a malicious filename with the intention to corrupt or hack your application.Implementations SHOULD return the value stored in the "name" key of the file in the $_FILES array.
Implements Psr\Http\Message\UploadedFileInterface.
Definition at line 304 of file UploadedFile.php.
References GuzzleHttp\Psr7\UploadedFile\$clientFilename.
GuzzleHttp\Psr7\UploadedFile::getClientMediaType | ( | ) |
{Retrieve the media type sent by the client.Do not trust the value returned by this method. A client could send a malicious media type with the intention to corrupt or hack your application.Implementations SHOULD return the value stored in the "type" key of the file in the $_FILES array.
Implements Psr\Http\Message\UploadedFileInterface.
Definition at line 312 of file UploadedFile.php.
References GuzzleHttp\Psr7\UploadedFile\$clientMediaType.
GuzzleHttp\Psr7\UploadedFile::getError | ( | ) |
{Retrieve the error associated with the uploaded file.The return value MUST be one of PHP's UPLOAD_ERR_XXX constants.If the file was uploaded successfully, this method MUST return UPLOAD_ERR_OK.Implementations SHOULD return the value stored in the "error" key of the file in the $_FILES array.
Implements Psr\Http\Message\UploadedFileInterface.
Definition at line 293 of file UploadedFile.php.
References GuzzleHttp\Psr7\UploadedFile\$error.
GuzzleHttp\Psr7\UploadedFile::getSize | ( | ) |
{Retrieve the file size.Implementations SHOULD return the value stored in the "size" key of the file in the $_FILES array if available, as PHP calculates this based on the actual size transmitted.
Implements Psr\Http\Message\UploadedFileInterface.
Definition at line 282 of file UploadedFile.php.
References GuzzleHttp\Psr7\UploadedFile\$size.
GuzzleHttp\Psr7\UploadedFile::getStream | ( | ) |
{Retrieve a stream representing the uploaded file.This method MUST return a StreamInterface instance, representing the uploaded file. The purpose of this method is to allow utilizing native PHP stream functionality to manipulate the file upload, such as stream_copy_to_stream() (though the result will need to be decorated in a native PHP stream wrapper to work with such functions).If the moveTo() method has been called previously, this method MUST raise an exception.
RuntimeException | if the upload was not successful. |
Implements Psr\Http\Message\UploadedFileInterface.
Definition at line 225 of file UploadedFile.php.
References GuzzleHttp\Psr7\UploadedFile\$stream, and GuzzleHttp\Psr7\UploadedFile\validateActive().
Referenced by GuzzleHttp\Psr7\UploadedFile\moveTo().
GuzzleHttp\Psr7\UploadedFile::isMoved | ( | ) |
Definition at line 202 of file UploadedFile.php.
References GuzzleHttp\Psr7\UploadedFile\$moved.
Referenced by GuzzleHttp\Psr7\UploadedFile\validateActive().
|
private |
Return true if there is no upload error.
Definition at line 194 of file UploadedFile.php.
Referenced by GuzzleHttp\Psr7\UploadedFile\__construct(), and GuzzleHttp\Psr7\UploadedFile\validateActive().
|
private |
mixed | $param |
Definition at line 154 of file UploadedFile.php.
Referenced by GuzzleHttp\Psr7\UploadedFile\moveTo().
|
private |
mixed | $param |
Definition at line 145 of file UploadedFile.php.
Referenced by GuzzleHttp\Psr7\UploadedFile\setClientFilename(), and GuzzleHttp\Psr7\UploadedFile\setClientMediaType().
GuzzleHttp\Psr7\UploadedFile::moveTo | ( | $targetPath | ) |
{Move the uploaded file to a new location.Use this method as an alternative to move_uploaded_file(). This method is guaranteed to work in both SAPI and non-SAPI environments. Implementations must determine which environment they are in, and use the appropriate method (move_uploaded_file(), rename(), or a stream operation) to perform the operation.$targetPath may be an absolute path, or a relative path. If it is a relative path, resolution should be the same as used by PHP's rename() function.The original file or stream MUST be removed on completion.If this method is called more than once, any subsequent calls MUST raise an exception.When used in an SAPI environment where $_FILES is populated, when writing files via moveTo(), is_uploaded_file() and move_uploaded_file() SHOULD be used to ensure permissions and upload status are verified correctly.If you wish to move to a stream, use getStream(), as SAPI operations cannot guarantee writing to stream destinations.
string | $targetPath | Path to which to move the uploaded file. |
string | $targetPath | Path to which to move the uploaded file. |
RuntimeException | if the upload was not successful. |
InvalidArgumentException | if the $path specified is invalid. |
RuntimeException | on any error during the move operation, or on the second or subsequent call to the method. |
Implements Psr\Http\Message\UploadedFileInterface.
Definition at line 247 of file UploadedFile.php.
References GuzzleHttp\Psr7\copy_to_stream(), GuzzleHttp\Psr7\UploadedFile\getStream(), GuzzleHttp\Psr7\UploadedFile\isStringNotEmpty(), and GuzzleHttp\Psr7\UploadedFile\validateActive().
|
private |
string | null | $clientFilename |
InvalidArgumentException |
Definition at line 163 of file UploadedFile.php.
References GuzzleHttp\Psr7\UploadedFile\$clientFilename, and GuzzleHttp\Psr7\UploadedFile\isStringOrNull().
Referenced by GuzzleHttp\Psr7\UploadedFile\__construct().
|
private |
string | null | $clientMediaType |
InvalidArgumentException |
Definition at line 178 of file UploadedFile.php.
References GuzzleHttp\Psr7\UploadedFile\$clientMediaType, and GuzzleHttp\Psr7\UploadedFile\isStringOrNull().
Referenced by GuzzleHttp\Psr7\UploadedFile\__construct().
|
private |
int | $error |
InvalidArgumentException |
Definition at line 109 of file UploadedFile.php.
References GuzzleHttp\Psr7\UploadedFile\$error, and GuzzleHttp\Psr7\UploadedFile\$errors.
Referenced by GuzzleHttp\Psr7\UploadedFile\__construct().
|
private |
int | $size |
InvalidArgumentException |
Definition at line 130 of file UploadedFile.php.
References GuzzleHttp\Psr7\UploadedFile\$size, and size.
Referenced by GuzzleHttp\Psr7\UploadedFile\__construct().
|
private |
Depending on the value set file or stream variable.
mixed | $streamOrFile |
InvalidArgumentException |
Definition at line 90 of file UploadedFile.php.
Referenced by GuzzleHttp\Psr7\UploadedFile\__construct().
|
private |
RuntimeException | if is moved or not ok |
Definition at line 210 of file UploadedFile.php.
References GuzzleHttp\Psr7\UploadedFile\isMoved(), and GuzzleHttp\Psr7\UploadedFile\isOk().
Referenced by GuzzleHttp\Psr7\UploadedFile\getStream(), and GuzzleHttp\Psr7\UploadedFile\moveTo().
|
private |
Definition at line 28 of file UploadedFile.php.
Referenced by GuzzleHttp\Psr7\UploadedFile\__construct(), GuzzleHttp\Psr7\UploadedFile\getClientFilename(), and GuzzleHttp\Psr7\UploadedFile\setClientFilename().
|
private |
Definition at line 33 of file UploadedFile.php.
Referenced by GuzzleHttp\Psr7\UploadedFile\__construct(), GuzzleHttp\Psr7\UploadedFile\getClientMediaType(), and GuzzleHttp\Psr7\UploadedFile\setClientMediaType().
|
private |
Definition at line 38 of file UploadedFile.php.
Referenced by GuzzleHttp\Psr7\UploadedFile\getError(), and GuzzleHttp\Psr7\UploadedFile\setError().
|
staticprivate |
Definition at line 14 of file UploadedFile.php.
Referenced by GuzzleHttp\Psr7\UploadedFile\setError().
|
private |
Definition at line 43 of file UploadedFile.php.
|
private |
Definition at line 48 of file UploadedFile.php.
Referenced by GuzzleHttp\Psr7\UploadedFile\isMoved().
|
private |
Definition at line 53 of file UploadedFile.php.
Referenced by GuzzleHttp\Psr7\UploadedFile\__construct(), GuzzleHttp\Psr7\UploadedFile\getSize(), and GuzzleHttp\Psr7\UploadedFile\setSize().
|
private |
Definition at line 58 of file UploadedFile.php.
Referenced by GuzzleHttp\Psr7\UploadedFile\getStream().