[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/vendor/symfony/http-foundation/File/ -> UploadedFile.php (summary)

(no description)

File Size: 281 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

UploadedFile:: (12 methods):
  __construct()
  getClientOriginalName()
  getClientOriginalExtension()
  getClientMimeType()
  guessClientExtension()
  getClientSize()
  getError()
  isValid()
  move()
  getMaxFilesize()
  parseFilesize()
  getErrorMessage()


Class: UploadedFile  - X-Ref

A file uploaded through a form.

__construct($path, $originalName, $mimeType = null, $size = null, $error = null, $test = false)   X-Ref
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:

* getClientOriginalName,
* getClientMimeType,
* isValid,
* getError.

Calling any other method on an non-valid instance will cause an unpredictable result.

param: string      $path         The full temporary path to the file
param: string      $originalName The original file name of the uploaded file
param: string|null $mimeType     The type of the file as provided by PHP; null defaults to application/octet-stream
param: int|null    $size         The file size provided by the uploader
param: int|null    $error        The error constant of the upload (one of PHP's UPLOAD_ERR_XXX constants); null defaults to UPLOAD_ERR_OK
param: bool        $test         Whether the test mode is active

getClientOriginalName()   X-Ref
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.

return: string The original name

getClientOriginalExtension()   X-Ref
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.

return: string The extension

getClientMimeType()   X-Ref
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).

return: string The mime type

guessClientExtension()   X-Ref
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).

return: string|null The guessed extension or null if it cannot be guessed

getClientSize()   X-Ref
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.

return: int|null The file size

getError()   X-Ref
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.

return: int The upload error

isValid()   X-Ref
Returns whether the file was uploaded successfully.

return: bool True if the file has been uploaded with HTTP and no error occurred

move($directory, $name = null)   X-Ref
Moves the file to a new location.

param: string $directory The destination folder
param: string $name      The new file name
return: File A File object representing the new file

getMaxFilesize()   X-Ref
Returns the maximum size of an uploaded file as configured in php.ini.

return: int The maximum size of an uploaded file in bytes

parseFilesize($size)   X-Ref
Returns the given size from an ini value in bytes.

return: int The given size in bytes

getErrorMessage()   X-Ref
Returns an informative upload error message.

return: string The error message regarding the specified error code



Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1