UploadException

class UploadException extends FileException Thrown when an error occurred during file upload.

UploadedFile::move()

File move(string $directory, string $name = null) Moves the file to a new location. Parameters string $directory The destination folder string $name The new file name Return Value File A File object representing the new file Exceptions FileException if, for any reason, the file could not have been moved

UploadedFile::isValid()

bool isValid() Returns whether the file was uploaded successfully. Return Value bool True if the file has been uploaded with HTTP and no error occurred

UploadedFile::guessClientExtension()

string|null 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). Return Value string|null The guessed extension or null if it c

UploadedFile::getMaxFilesize()

static int getMaxFilesize() Returns the maximum size of an uploaded file as configured in php.ini. Return Value int The maximum size of an uploaded file in bytes

UploadedFile::getErrorMessage()

string getErrorMessage() Returns an informative upload error message. Return Value string The error message regarding the specified error code

UploadedFile::getError()

int getError() Returns the upload error. If the upload was successful, the constant UPLOADERROK is returned. Otherwise one of the other UPLOADERRXXX constants is returned. Return Value int The upload error

UploadedFile::getClientSize()

int|null 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. Return Value int|null The file size

UploadedFile::getClientOriginalName()

string|null 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. Return Value string|null The original name

UploadedFile::getClientOriginalExtension()

string 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. Return Value string The extension