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 cannot be guessed

See also

guessExtension()
getClientMimeType()
doc_Symfony
2016-10-28 06:36:00
Comments
Leave a Comment

Please login to continue.