public function generateFileExtension(UploadedFile $uploadedFile)
    {
        // Retrieve original file name
        $filePath = $uploadedFile->getClientOriginalName();

        // Parse URL
        $fileInfo = pathinfo($filePath);

        // Return extension is available
        if (! empty($fileInfo['extension'])) {
            return strtolower($fileInfo['extension']);
        }

        throw ( new AssetsBadRequestException('Cannot detect file extension, provide it before uploading.') )->setStatusCode(400);
    }
public function generateFileExtension(UploadedFile $uploadedFile)
    {
        // Retrieve original file name
        $filePath = $uploadedFile->getClientOriginalName();

        // Parse URL
        $fileInfo = pathinfo($filePath);

        // Return extension is available
        if (! empty($fileInfo['extension'])) {
            return strtolower($fileInfo['extension']);
        }

        throw ( new AssetsBadRequestException('Cannot detect file extension, provide it before uploading.') )->setStatusCode(400);
    }
public function generateFileExtension ( UploadedFile $ uploadedFile ) { // Retrieve original file name $ filePath = $ uploadedFile -> getClientOriginalName ( ) ; // Parse URL $ fileInfo = pathinfo ( $ filePath ) ; // Return extension is available if ( ! empty ( $ fileInfo [ 'extension' ] ) ) { return strtolower ( $ fileInfo [ 'extension' ] ) ; } throw ( new AssetsBadRequestException ( 'Cannot detect file extension, provide it before uploading.' ) ) -> setStatusCode ( 400 ) ; }
Generate file extension.

@author Casper Rasmussen <cr@nodes.dk>

@param  \Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile

@return string
@throws \Nodes\Assets\Upload\Exceptions\AssetsBadRequestException
Generate file extension .