Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct ($path, $originalName, $mimeType=null, $size=null, $error=null, $test=false) | |
__construct (string $path, string $originalName, string $mimeType=null, int $error=null, $test=false) | |
getClientMimeType () | |
getClientMimeType () | |
getClientOriginalExtension () | |
getClientOriginalExtension () | |
getClientOriginalName () | |
getClientOriginalName () | |
getClientSize () | |
getClientSize () | |
getError () | |
getError () | |
getErrorMessage () | |
getErrorMessage () | |
guessClientExtension () | |
guessClientExtension () | |
isValid () | |
isValid () | |
move ($directory, $name=null) | |
move ($directory, $name=null) | |
![]() | |
__construct ($path, $checkPath=true) | |
__construct (string $path, bool $checkPath=true) | |
getMimeType () | |
getMimeType () | |
guessExtension () | |
guessExtension () | |
Static Public Member Functions | |
static | getMaxFilesize () |
static | getMaxFilesize () |
Additional Inherited Members | |
![]() | |
getName ($name) | |
getName ($name) | |
getTargetFile ($directory, $name=null) | |
getTargetFile ($directory, $name=null) | |
A file uploaded through a form.
Definition at line 25 of file lib/vendor/symfony/http-foundation/File/UploadedFile.php.
Symfony\Component\HttpFoundation\File\UploadedFile::__construct | ( | $path, | |
$originalName, | |||
$mimeType = null , |
|||
$size = null , |
|||
$error = null , |
|||
$test = false |
|||
) |
Accepts the information of the uploaded file as provided by the PHP global $_FILES.
The file object is only created when the uploaded file is valid (i.e. when the isValid() method returns true). Otherwise the only methods that could be called on an UploadedFile instance are:
Calling any other method on an non-valid instance will cause an unpredictable result.
string | $path | The full temporary path to the file |
string | $originalName | The original file name |
string | null | $mimeType | The type of the file as provided by PHP; null defaults to application/octet-stream |
int | null | $size | The file size |
int | null | $error | The error constant of the upload (one of PHP's UPLOAD_ERR_XXX constants); null defaults to UPLOAD_ERR_OK |
bool | $test | Whether the test mode is active |
FileException | If file_uploads is disabled |
FileNotFoundException | If the file does not exist |
Definition at line 103 of file lib/vendor/symfony/http-foundation/File/UploadedFile.php.
References Symfony\Component\HttpFoundation\File\File\getName().
Symfony\Component\HttpFoundation\File\UploadedFile::__construct | ( | string | $path, |
string | $originalName, | ||
string | $mimeType = null , |
||
int | $error = null , |
||
$test = false |
|||
) |
Accepts the information of the uploaded file as provided by the PHP global $_FILES.
The file object is only created when the uploaded file is valid (i.e. when the isValid() method returns true). Otherwise the only methods that could be called on an UploadedFile instance are:
Calling any other method on an non-valid instance will cause an unpredictable result.
string | $path | The full temporary path to the file |
string | $originalName | The original file name of the uploaded file |
string | null | $mimeType | The type of the file as provided by PHP; null defaults to application/octet-stream |
int | null | $error | The error constant of the upload (one of PHP's UPLOAD_ERR_XXX constants); null defaults to UPLOAD_ERR_OK |
bool | $test | Whether the test mode is active Local files are used in test mode hence the code should not enforce HTTP uploads |
FileException | If file_uploads is disabled |
FileNotFoundException | If the file does not exist |
Definition at line 63 of file vendor/symfony/http-foundation/File/UploadedFile.php.
References Symfony\Component\HttpFoundation\File\File\getName().
Symfony\Component\HttpFoundation\File\UploadedFile::getClientMimeType | ( | ) |
Returns the file mime type.
The client mime type is extracted from the request from which the file was uploaded, so it should not be considered as a safe value.
For a trusted mime type, use getMimeType() instead (which guesses the mime type based on the file content).
Definition at line 119 of file vendor/symfony/http-foundation/File/UploadedFile.php.
Symfony\Component\HttpFoundation\File\UploadedFile::getClientMimeType | ( | ) |
Returns the file mime type.
The client mime type is extracted from the request from which the file was uploaded, so it should not be considered as a safe value.
For a trusted mime type, use getMimeType() instead (which guesses the mime type based on the file content).
Definition at line 153 of file lib/vendor/symfony/http-foundation/File/UploadedFile.php.
Referenced by Symfony\Component\HttpFoundation\File\UploadedFile\guessClientExtension().
Symfony\Component\HttpFoundation\File\UploadedFile::getClientOriginalExtension | ( | ) |
Returns the original file extension.
It is extracted from the original file name that was uploaded. Then it should not be considered as a safe value.
Definition at line 101 of file vendor/symfony/http-foundation/File/UploadedFile.php.
Symfony\Component\HttpFoundation\File\UploadedFile::getClientOriginalExtension | ( | ) |
Returns the original file extension.
It is extracted from the original file name that was uploaded. Then it should not be considered as a safe value.
Definition at line 135 of file lib/vendor/symfony/http-foundation/File/UploadedFile.php.
Symfony\Component\HttpFoundation\File\UploadedFile::getClientOriginalName | ( | ) |
Returns the original file name.
It is extracted from the request from which the file has been uploaded. Then it should not be considered as a safe value.
Definition at line 88 of file vendor/symfony/http-foundation/File/UploadedFile.php.
Symfony\Component\HttpFoundation\File\UploadedFile::getClientOriginalName | ( | ) |
Returns the original file name.
It is extracted from the request from which the file has been uploaded. Then it should not be considered as a safe value.
Definition at line 122 of file lib/vendor/symfony/http-foundation/File/UploadedFile.php.
Referenced by Symfony\Component\HttpFoundation\File\UploadedFile\getErrorMessage().
Symfony\Component\HttpFoundation\File\UploadedFile::getClientSize | ( | ) |
Returns the file size.
It is extracted from the request from which the file has been uploaded. Then it should not be considered as a safe value.
Definition at line 156 of file vendor/symfony/http-foundation/File/UploadedFile.php.
Symfony\Component\HttpFoundation\File\UploadedFile::getClientSize | ( | ) |
Returns the file size.
It is extracted from the request from which the file has been uploaded. Then it should not be considered as a safe value.
Definition at line 191 of file lib/vendor/symfony/http-foundation/File/UploadedFile.php.
Symfony\Component\HttpFoundation\File\UploadedFile::getError | ( | ) |
Returns the upload error.
If the upload was successful, the constant UPLOAD_ERR_OK is returned. Otherwise one of the other UPLOAD_ERR_XXX constants is returned.
Definition at line 171 of file vendor/symfony/http-foundation/File/UploadedFile.php.
Symfony\Component\HttpFoundation\File\UploadedFile::getError | ( | ) |
Returns the upload error.
If the upload was successful, the constant UPLOAD_ERR_OK is returned. Otherwise one of the other UPLOAD_ERR_XXX constants is returned.
Definition at line 204 of file lib/vendor/symfony/http-foundation/File/UploadedFile.php.
Symfony\Component\HttpFoundation\File\UploadedFile::getErrorMessage | ( | ) |
Returns an informative upload error message.
Definition at line 290 of file lib/vendor/symfony/http-foundation/File/UploadedFile.php.
References Symfony\Component\HttpFoundation\File\UploadedFile\getClientOriginalName(), and Symfony\Component\HttpFoundation\File\UploadedFile\getMaxFilesize().
Referenced by Symfony\Component\HttpFoundation\File\UploadedFile\move().
Symfony\Component\HttpFoundation\File\UploadedFile::getErrorMessage | ( | ) |
Returns an informative upload error message.
Definition at line 290 of file vendor/symfony/http-foundation/File/UploadedFile.php.
References Symfony\Component\HttpFoundation\File\UploadedFile\getClientOriginalName(), and Symfony\Component\HttpFoundation\File\UploadedFile\getMaxFilesize().
|
static |
Returns the maximum size of an uploaded file as configured in php.ini.
Definition at line 244 of file vendor/symfony/http-foundation/File/UploadedFile.php.
|
static |
Returns the maximum size of an uploaded file as configured in php.ini.
Definition at line 258 of file lib/vendor/symfony/http-foundation/File/UploadedFile.php.
Referenced by Symfony\Component\HttpFoundation\File\UploadedFile\getErrorMessage().
Symfony\Component\HttpFoundation\File\UploadedFile::guessClientExtension | ( | ) |
Returns the extension based on the client mime type.
If the mime type is unknown, returns null.
This method uses the mime type as guessed by getClientMimeType() to guess the file extension. As such, the extension returned by this method cannot be trusted.
For a trusted extension, use guessExtension() instead (which guesses the extension based on the guessed mime type for the file).
Definition at line 141 of file vendor/symfony/http-foundation/File/UploadedFile.php.
References Symfony\Component\HttpFoundation\File\UploadedFile\getClientMimeType(), and Symfony\Component\Mime\MimeTypes\getDefault().
Symfony\Component\HttpFoundation\File\UploadedFile::guessClientExtension | ( | ) |
Returns the extension based on the client mime type.
If the mime type is unknown, returns null.
This method uses the mime type as guessed by getClientMimeType() to guess the file extension. As such, the extension returned by this method cannot be trusted.
For a trusted extension, use guessExtension() instead (which guesses the extension based on the guessed mime type for the file).
Definition at line 175 of file lib/vendor/symfony/http-foundation/File/UploadedFile.php.
References Symfony\Component\HttpFoundation\File\UploadedFile\getClientMimeType(), and Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser\getInstance().
Symfony\Component\HttpFoundation\File\UploadedFile::isValid | ( | ) |
Returns whether the file was uploaded successfully.
Definition at line 181 of file vendor/symfony/http-foundation/File/UploadedFile.php.
Symfony\Component\HttpFoundation\File\UploadedFile::isValid | ( | ) |
Returns whether the file was uploaded successfully.
Definition at line 214 of file lib/vendor/symfony/http-foundation/File/UploadedFile.php.
Referenced by Symfony\Component\HttpFoundation\File\UploadedFile\move().
Symfony\Component\HttpFoundation\File\UploadedFile::move | ( | $directory, | |
$name = null |
|||
) |
Moves the file to a new location.
string | $directory | The destination folder |
string | $name | The new file name |
FileException | if, for any reason, the file could not have been moved |
Reimplemented from Symfony\Component\HttpFoundation\File\File.
Definition at line 198 of file vendor/symfony/http-foundation/File/UploadedFile.php.
References Symfony\Component\HttpFoundation\File\UploadedFile\getErrorMessage(), Symfony\Component\HttpFoundation\File\File\getTargetFile(), and Symfony\Component\HttpFoundation\File\UploadedFile\isValid().
Symfony\Component\HttpFoundation\File\UploadedFile::move | ( | $directory, | |
$name = null |
|||
) |
Moves the file to a new location.
string | $directory | The destination folder |
string | $name | The new file name |
FileException | if, for any reason, the file could not have been moved |
Reimplemented from Symfony\Component\HttpFoundation\File\File.
Definition at line 231 of file lib/vendor/symfony/http-foundation/File/UploadedFile.php.
References Symfony\Component\HttpFoundation\File\UploadedFile\getErrorMessage(), Symfony\Component\HttpFoundation\File\File\getTargetFile(), and Symfony\Component\HttpFoundation\File\UploadedFile\isValid().