final public function setDestinationFilename(string $filename)
    {
        $extension = pathinfo($filename, PATHINFO_EXTENSION);
        if (empty($extension) && !empty($this->uploadFile->getExtension())) {
            $filename .= '.' . $this->uploadFile->getExtension();
        }
        $this->destinationFilename = $filename;
    }
final public function setDestinationFilename(string $filename)
    {
        $extension = pathinfo($filename, PATHINFO_EXTENSION);
        if (empty($extension) && !empty($this->uploadFile->getExtension())) {
            $filename .= '.' . $this->uploadFile->getExtension();
        }
        $this->destinationFilename = $filename;
    }
final public function setDestinationFilename ( string $ filename ) { $ extension = pathinfo ( $ filename , PATHINFO_EXTENSION ) ; if ( empty ( $ extension ) && ! empty ( $ this -> uploadFile -> getExtension ( ) ) ) { $ filename .= '.' . $ this -> uploadFile -> getExtension ( ) ; } $ this -> destinationFilename = $ filename ; }
Apply the uploaded filename to be used in the destination directory. To
keep the same extension, simply omit to specify it in the filename.

@param string $filename
Apply the uploaded filename to be used in the destination directory . To keep the same extension simply omit to specify it in the filename .