src/Kunstmaan/FormBundle/Entity/FormSubmissionFieldTypes/FileFormSubmissionField.php
public function getSafeFileName()
    {
        $fileExtension = pathinfo($this->file->getClientOriginalName(), PATHINFO_EXTENSION);
        $mimeTypeExtension = $this->file->guessExtension();
        $newExtension = !empty($mimeTypeExtension) ? $mimeTypeExtension : $fileExtension;

        $baseName = !empty($fileExtension) ? basename($this->file->getClientOriginalName(), $fileExtension) : $this->file->getClientOriginalName();
        $safeBaseName = Transliterator::urlize($baseName);

        return $safeBaseName . (!empty($newExtension) ? '.' . $newExtension : '');
    }
public function getSafeFileName()
    {
        $fileExtension = pathinfo($this->file->getClientOriginalName(), PATHINFO_EXTENSION);
        $mimeTypeExtension = $this->file->guessExtension();
        $newExtension = !empty($mimeTypeExtension) ? $mimeTypeExtension : $fileExtension;

        $baseName = !empty($fileExtension) ? basename($this->file->getClientOriginalName(), $fileExtension) : $this->file->getClientOriginalName();
        $safeBaseName = Transliterator::urlize($baseName);

        return $safeBaseName . (!empty($newExtension) ? '.' . $newExtension : '');
    }
public function getSafeFileName ( ) { $ fileExtension = pathinfo ( $ this -> file -> getClientOriginalName ( ) , PATHINFO_EXTENSION ) ; $ mimeTypeExtension = $ this -> file -> guessExtension ( ) ; $ newExtension = ! empty ( $ mimeTypeExtension ) ? $ mimeTypeExtension : $ fileExtension ; $ baseName = ! empty ( $ fileExtension ) ? basename ( $ this -> file -> getClientOriginalName ( ) , $ fileExtension ) : $ this -> file -> getClientOriginalName ( ) ; $ safeBaseName = Transliterator :: urlize ( $ baseName ) ; return $ safeBaseName . ( ! empty ( $ newExtension ) ? '.' . $ newExtension : '' ) ; }
Create a safe file name for the uploaded file, so that it can be saved safely on the disk.

@return string
Create a safe file name for the uploaded file so that it can be saved safely on the disk .