public function setFilename($filename)
    {
        $this->throwExceptionIfProtected();

        $pathInfo = UnicodeFunctions::pathinfo($filename);
        $extension = (isset($pathInfo['extension']) ? '.' . strtolower($pathInfo['extension']) : '');
        $this->filename = $pathInfo['filename'] . $extension;
        $this->mediaType = Utility\MediaTypes::getMediaTypeFromFilename($this->filename);
    }
public function setFilename($filename)
    {
        $this->throwExceptionIfProtected();

        $pathInfo = UnicodeFunctions::pathinfo($filename);
        $extension = (isset($pathInfo['extension']) ? '.' . strtolower($pathInfo['extension']) : '');
        $this->filename = $pathInfo['filename'] . $extension;
        $this->mediaType = Utility\MediaTypes::getMediaTypeFromFilename($this->filename);
    }
public function setFilename ( $ filename ) { $ this -> throwExceptionIfProtected ( ) ; $ pathInfo = UnicodeFunctions :: pathinfo ( $ filename ) ; $ extension = ( isset ( $ pathInfo [ 'extension' ] ) ? '.' . strtolower ( $ pathInfo [ 'extension' ] ) : '' ) ; $ this -> filename = $ pathInfo [ 'filename' ] . $ extension ; $ this -> mediaType = Utility \ MediaTypes :: getMediaTypeFromFilename ( $ this -> filename ) ; }
Sets the filename which is used when this resource is downloaded or saved as a file

@param string $filename
@return void
@api
Sets the filename which is used when this resource is downloaded or saved as a file