Symfony\Component\HttpFoundation\File\UploadedFile
A file uploaded through a form.
- Author: Bernhard Schussek <bschussek@gmail.com>
Synopsis
class UploadedFile
extends File
{
- // members
- private Boolean $test;
- private string $originalName;
- private string $mimeType;
- private string $size;
- private integer $error;
- // methods
- public void __construct()
- public string|null getClientOriginalName()
- public string getClientOriginalExtension()
- public string|null getClientMimeType()
- public string|null guessClientExtension()
- public integer|null getClientSize()
- public integer getError()
- public Boolean isValid()
- public File move()
- public static int getMaxFilesize()
- private string getErrorMessage()
- // Inherited methods from File
- public void __construct()
- public string|null guessExtension()
- public string|null getMimeType()
- public string getExtension()
- public File move()
- protected void getTargetFile()
- protected string getName()
- // Inherited methods from SplFileInfo
- public void __construct()
- public int getATime()
- public string getBasename()
- public int getCTime()
- public string getExtension()
- public SplFileInfo getFileInfo()
- public string getFilename()
- public int getGroup()
- public int getInode()
- public string getLinkTarget()
- public int getMTime()
- public int getOwner()
- public string getPath()
- public SplFileInfo getPathInfo()
- public string getPathname()
- public int getPerms()
- public string getRealPath()
- public int getSize()
- public string getType()
- public bool isDir()
- public bool isExecutable()
- public bool isFile()
- public bool isLink()
- public bool isReadable()
- public bool isWritable()
- public SplFileObject openFile()
- public void setFileClass()
- public void setInfoClass()
- public void __toString()
Hierarchy
Members
private
- $error
—
integer
The UPLOAD_ERR_XXX constant provided by the uploader. - $mimeType
—
string
The mime type provided by the uploader. - $originalName
—
string
The original name of the uploaded file. - $size
—
string
The file size provided by the uploader. - $test
—
Symfony\Component\HttpFoundation\File\Boolean
Whether the test mode is activated.
Methods
private
- getErrorMessage() — Returns an informative upload error message.
public
- __construct() — Accepts the information of the uploaded file as provided by the PHP global $_FILES.
- getClientMimeType() — Returns the file mime type.
- getClientOriginalExtension() — Returns the original file extension
- getClientOriginalName() — Returns the original file name.
- getClientSize() — Returns the file size.
- getError() — Returns the upload error.
- getMaxFilesize() — Returns the maximum size of an uploaded file as configured in php.ini
- guessClientExtension() — Returns the extension based on the client mime type.
- isValid() — Returns whether the file was uploaded successfully.
- move() — Moves the file to a new location.
Inherited from Symfony\Component\HttpFoundation\File\File
protected
- getName() — Returns locale independent base name of the given path.
- getTargetFile()
public
- getExtension() — Returns the extension of the file.
- getMimeType() — Returns the mime type of the file.
- guessExtension() — Returns the extension based on the mime type.
- move() — Moves the file to a new location.
Inherited from SplFileInfo
public
- __toString() — Returns the path to the file as a string
- getATime() — Gets last access time of the file
- getBasename() — Gets the base name of the file
- getCTime() — Gets the inode change time
- getExtension() — Gets the file extension
- getFileInfo() — Gets an SplFileInfo object for the file
- getFilename() — Gets the filename
- getGroup() — Gets the file group
- getInode() — Gets the inode for the file
- getLinkTarget() — Gets the target of a link
- getMTime() — Gets the last modified time
- getOwner() — Gets the owner of the file
- getPath() — Gets the path without filename
- getPathInfo() — Gets an SplFileInfo object for the path
- getPathname() — Gets the path to the file
- getPerms() — Gets file permissions
- getRealPath() — Gets absolute path to file
- getSize() — Gets file size
- getType() — Gets file type
- isDir() — Tells if the file is a directory
- isExecutable() — Tells if the file is executable
- isFile() — Tells if the object references a regular file
- isLink() — Tells if the file is a link
- isReadable() — Tells if file is readable
- isWritable() — Tells if the entry is writable
- openFile() — Gets an SplFileObject object for the file
- setFileClass() — Sets the class name used with SplFileInfo::openFile
- setInfoClass() — Sets the class used with getFileInfo and getPathInfo