class File extends SplFileInfo
A file in the file system.
__construct(string $path, bool $checkPath = true) Constructs a new file from the given path. | ||
string|null | guessExtension() Returns the extension based on the mime type. | |
string|null | getMimeType() Returns the mime type of the file. | |
File | move(string $directory, string $name = null) Moves the file to a new location. |
Constructs a new file from the given path.
Returns the extension based on the mime type.
If the mime type is unknown, returns null.
This method uses the mime type as guessed by getMimeType() to guess the file extension.
Returns the mime type of the file.
The mime type is guessed using a MimeTypeGuesser instance, which uses finfo(), mimecontenttype() and the system binary "file" (in this order), depending on which of those are available.
Moves the file to a new location.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.1/Symfony/Component/HttpFoundation/File/File.html