Set the filename for the uploaded csv file

@param string $dataname    The name of the module.
@param string $extenstion  File extension for the file.
777956
public function set_filename($dataname, $extension = '.csv') {
        $filename = clean_filename($dataname);
        $filename .= clean_filename('-' . gmdate("Ymd_Hi"));
        $filename .= clean_filename("-{$this->delimiter}_separated");
        $filename .= $extension;
        $this->filename = $filename;
    }
6833
public function setTemplateExtension($extension)
    {
        $extension = (string) $extension;
        $extension = trim($extension);
        if ('.' == $extension[0]) {
            $extension = substr($extension, 1);
        }

        $this->extension = $extension;
    }
1021494
public function validExt($filename){
        $exts = $this->config['ext'];
        $ext = $this->getExtension($filename);
        if(array_search($ext,$exts)===false){
            return false;
        }else{
            return true;
        }


    }
305660
public function setExtbaseConfiguration($pluginName, $controllerClass, $actionName, $extensionName = null)
    {
        // Validate the extension name
        if (!empty($extensionName)) {
            $extensionName = GeneralUtility::camelCaseToLowerCaseUnderscored(trim($extensionName));
            if (!in_array($extensionName, ExtensionManagementUtility::getLoadedExtensionListArray())) {
                throw new \RuntimeException(sprintf('Extension "%s" is not available', $extensionName), 1481645834);
            }
            $this->extbaseExtensionName = $extensionName;
        }

        // Validate the plugin name
        $pluginName = trim($pluginName);
        if (empty($pluginName)) {
            throw new \RuntimeException(sprintf('Invalid plugin name "%s"', $pluginName), 1481646376);
        }
        $this->extbasePlugin = $pluginName;

        // Validate the controller name
        $controllerClass = trim($controllerClass);
        if (empty($controllerClass)
            || !class_exists($controllerClass)
            || !($controllerReflection = new \ReflectionClass($controllerClass))->implementsInterface(
                ControllerInterface::class
            )
        ) {
            throw new \RuntimeException(sprintf('Invalid controller class "%s"', $controllerClass), 1481646376);
        }
        $this->extbaseControllerClass = $controllerClass;
        $this->extbaseController      = preg_replace('/Controller$/', '', $controllerReflection->getShortName());

        // Validate the controller action
        $actionName = trim($actionName);
        if (empty($actionName) || !is_callable([$this->extbaseControllerClass, $actionName.'Action'])) {
            throw new \RuntimeException(sprintf('Invalid controller action "%s"', $actionName), 1481646569);
        }
        $this->extbaseAction = $actionName;

        // Construct the controller argument request prefix
        $this->controllerArgumentRequestPrefix = 'tx_'.strtolower(str_replace('_', '', $this->extbaseExtensionName)).
                                                 '_'.strtolower($this->extbasePlugin);

        // Construct and set the controller request arguments
        $this->request->setControllerObjectName($this->extbaseControllerClass);
        $this->request->setControllerExtensionName($this->extbaseExtensionName);
        $this->request->setControllerName($this->extbaseController);
        $this->request->setControllerActionName($this->extbaseAction);
        $this->request->setPluginName($this->extbasePlugin);
        $this->request->setArgument(
            $this->controllerArgumentRequestPrefix,
            [
                'controller' => $this->extbaseController,
                'action'     => $this->extbaseAction,
            ]
        );

        // Determine the default controller settings
        /** @var ConfigurationManagerInterface $configurationManager */
        $configurationManager     = $this->objectManager->get(ConfigurationManagerInterface::class);
        $this->controllerSettings = $configurationManager->getConfiguration(
            ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,
            GeneralUtility::underscoredToUpperCamelCase($this->extbaseExtensionName),
            $this->extbasePlugin
        );
    }
408152
protected function replaceExtension($filename, $ext)
    {
        $ext = str_replace('.', '', $ext);
        $filename = $this->removeExtension($filename);

        return $filename.'.'.$ext;
    }
232690
public function setFilename($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->filename !== $v) {
            $this->filename = $v;
            $this->modifiedColumns[MapTableMap::COL_FILENAME] = true;
        }

        return $this;
    }
1249329
public void setExcelFileName(String fileName) {
        Preconditions.checkArgument(StringUtils.endsWith(fileName, ".xls"), "Excel file name must end with '.xls'.");
        reportFileName = fileName;
    }
924175
public function setRestrictions($dataContainerName = null, $operationName = null)
    {
        parent::setRestrictions($dataContainerName);
        $this->operationName = $operationName;
    }
106251
private function writeFilename($filename, $data)
    {
        $f = fopen($filename, "w+");

        fwrite($f, implode('', $data));
        fclose($f);
    }
1251141
protected function setExtensionPath()
    {
        $filename = (new ReflectionClass($this))->getFileName();

        return $this->extensionPath = (new SplFileInfo($filename))->getPath();
    }
97233
public function extName($extName = null)
    {
        if (func_num_args() > 0) {
            $parts = pathinfo($this->_name);
            $this->_name = "{$parts['dirname']}/{$parts['filename']}.{$extName}";
            return $this;
        }
        return pathinfo($this->_name, PATHINFO_EXTENSION);
    }
478873
static function filenameWithoutExtension($filename) {
		$filename=self::filename($filename);
		if (preg_match('~(.*)\.(\w{1,10})$~',$filename,$parts)) {
			return $parts[1];
		}
		return $filename;
	}
142551
protected function _setFieldData($fieldName, $fieldValue, $dataType = Field::T_TEXT)
    {
        $longFieldName = $this->_getFieldLongName($fieldName);
        //$sLongFieldName = $this->_sCoreTable . "__" . strtolower($sFieldName);

        // doing this because in lazy loaded lists on first load it is harmful to have initialised fields but not yet set
        // situation: only first article is loaded fully for "select oxid from oxarticles"
        //if ($this->_blUseLazyLoading && !isset($this->$sLongFieldName))
        //    return;


        //in non lazy loading case we just add a field and do not care about it more
        if (!$this->_blUseLazyLoading
            && !$this->isPropertyLoaded($longFieldName)
        ) {
            $fieldsList = $this->_getAllFields(true);
            if (isset($fieldsList[strtolower($fieldName)])) {
                $this->_addField($fieldName, $this->_getFieldStatus($fieldName));
            }
        }
        // if we have a double field we replace "," with "." in case somebody enters it in european format
        $isPropertyLoaded = $this->isPropertyLoaded($longFieldName);
        if ($isPropertyLoaded
            && isset($this->$longFieldName->fldtype)
            && $this->$longFieldName->fldtype == 'double'
        ) {
            $fieldValue = str_replace(',', '.', $fieldValue);
        }

        // isset is REQUIRED here not to use getter
        if ($isPropertyLoaded
            && is_object($this->$longFieldName)
        ) {
            $this->$longFieldName->setValue($fieldValue, $dataType);
        } else {
            $this->$longFieldName = new Field($fieldValue, $dataType);
        }
    }
416859
public function setName($name)
    {
        if (!is_string($name) || (strlen($name) <= 0)) {
            $explodedNamespace = explode('\\', get_class($this));
            $class = $explodedNamespace[count($explodedNamespace) - 1];
            $asset = strtolower(preg_replace('/(.)([A-Z])/', '\\1 \\2', $class));

            throw SchemaException::invalidAssetName($asset);
        }

        $this->name = $name;
    }
1304230
public function rename($fieldName, $filename, $ext)
    {
        $filename = md5(time() . $fieldName . $filename . rand(1, 999)) . '.' . $ext;
        return $filename;
    }
616423
public function saveExtension(
        $uuid,
        $data,
        $extensionName,
        $webspaceKey,
        $locale,
        $userId
    ) {
        $document = $this->loadDocument(
            $uuid,
            $locale,
            [
                'exclude_ghost' => true,
            ]
        );

        if (null === $document) {
            throw new TranslatedNodeNotFoundException($uuid, $locale);
        }

        if (!$document instanceof ExtensionBehavior) {
            throw new \RuntimeException(
                sprintf(
                    'Document of class "%s" must implement the ExtensionableBehavior if it is to be extended',
                    get_class($document)
                )
            );
        }

        // save data of extensions
        $extension = $this->extensionManager->getExtension($document->getStructureType(), $extensionName);
        $node = $this->inspector->getNode($document);

        $extension->save($node, $data, $webspaceKey, $locale);
        $extensionData = $extension->load($node, $webspaceKey, $locale);

        $document->setExtension($extension->getName(), $extensionData);

        $this->documentManager->flush();

        $structure = $this->documentToStructure($document);

        $event = new ContentNodeEvent($node, $structure);
        $this->eventDispatcher->dispatch(ContentEvents::NODE_POST_SAVE, $event);

        return $structure;
    }
950837
public function addExtension(string $name, ?Struct $extension): void
    {
        $this->extensions[$name] = $extension;
    }