UploadValidatorExtension

class UploadValidatorExtension extends AbstractTypeExtension Methods buildForm(FormBuilderInterface $builder, array $options) Builds the form. from AbstractTypeExtension buildView(FormView $view, FormInterface $form, array $options) Builds the view. from AbstractTypeExtension finishView(FormView $view, FormInterface $form, array $options) Finishes the view. from AbstractTypeExtension configureOptions(OptionsResolver $resolver) Configures the options for this type. __constr

UploadException

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

UploadedFile::getErrorMessage()

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

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::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::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::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::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::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

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