Temporary upload path
@return bool|string
345472
public function getUploadTmpPath()
    {
        $path = Yii::getAlias('@root' . '/' . Yii::$app->params['uploads']['folderName'] . '/' . 'tmp');
        if (!file_exists($path)) {
            FileHelper::createDirectory($path, 0777);
        }
        return $path;
    }
68323
public function path(){

        $args = \func_get_args();

        switch (\count($args)){

            case 1:

                $file  = $args[0];

                if ($this->isAbsolutePath($file) && \file_exists($file)) {
                    return $file;
                }

                $parts = \explode(':', $file, 2);

                if (count($parts)==2){
                    if (!isset($this->paths[$parts[0]])) return false;

                    foreach ($this->paths[$parts[0]] as &$path){
                        if (\file_exists($path.$parts[1])){
                            return $path.$parts[1];
                        }
                    }
                }

                return false;

            case 2:

                if (!isset($this->paths[$args[0]])) {
                    $this->paths[$args[0]] = [];
                }
                \array_unshift($this->paths[$args[0]], \rtrim(\str_replace(DIRECTORY_SEPARATOR, '/', $args[1]), '/').'/');

                return $this;
        }

        return null;
    }
297535
protected function getUploadTempDir()
    {
        // Default upload dir
        $sUploadDir = $this->getOption('upload.default.dir');
        $sUploadDir = rtrim(trim($sUploadDir), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
        // Verify that the upload dir exists and is writable
        if(!is_writable($sUploadDir))
        {
            throw new \Jaxon\Exception\Error($this->trans('errors.upload.access'));
        }
        $sUploadDir .= 'tmp' . DIRECTORY_SEPARATOR;
        if(!@mkdir($sUploadDir))
        {
            throw new \Jaxon\Exception\Error($this->trans('errors.upload.access'));
        }
        return $sUploadDir;
    }
1320944
public function upload(): bool
    {
        $saved = $this->save();

        // ignore saving error
        $this->uploadFile($this->aliasConfig->getFileDirectory($this), $this->aliasConfig->getFileName($this));

        return $saved;
    }
541117
public function getTempPath(): string
    {
        $path = $this->getRuntimePath() . DIRECTORY_SEPARATOR . 'temp';
        FileHelper::createDirectory($path);
        return $path;
    }
419829
private function _prepareUploadData()
    {
        if (!$this->_createTargetDir()) {
            $this->_setError(PLUPLOAD_TMPDIR_ERR);
            return false;
        }
        $post = $this->_request->getPost();
        $this->_chunk = ($post->chunk) ? intval($post->chunk) : 0;
        $this->_chunks = ($post->chunks) ? intval($post->chunks) : 0;
        $this->_fileName = $post->name;
        $this->_fileId = $post->fileId;
        $this->_fileSize = $post->fileSize;
        $this->_formObject = $post->formObject;
        $this->_formObjectId = ($post->formObjectId) ? $post->formObjectId : null;
        $this->_cmsFileId = ($post->cmsFileId > 0) ? $post->cmsFileId : null;
        $this->_filters = ($post->filters) ? $post->filters : [];
        if (!$this->_fileName || !$this->_fileId || !$this->_fileSize || !$this->_formObject) {
            $this->_setError(PLUPLOAD_INPUT_ERR, "Błąd: niekompletne parametry żądania");
            return false;
        }
        $this->_filePath = $this->_targetDir . $this->_fileId;
        if (strrpos($this->_fileName, '.') > 0) {
            $this->_filePath .= substr($this->_fileName, strrpos($this->_fileName, '.'));
        }
        $this->_filePathPart = $this->_filePath . '.part';
        $this->_contentType = $this->_request->getContentType();
        return true;
    }
1340765
public function setPath()
	{
		$title = preg_replace("/[^a-zA-Z0-9]+/", " ", $this->properties['title']);
		$title = preg_replace('!\s+!', ' ', trim($title));
		
		return $this->config['dir']['post'] . '/' . Date('Y-m-d') . '-' . str_replace(" ", "-", strtolower($title)) . '.markdown';
	}
428596
public function isUploadedFile($path)
    {
        if (!$path) {
            return false;
        }
        if (mb_orig_strpos($path, $this->getUploadTempDir() . '/') !== 0) {
            return false;
        }
        foreach ($this->attrs->files as $file) {
            if ($file['tmp_name'] === $path) {
                return true;
            }
        }
        return false;
    }
382262
public function uploadImage()
    {
        $image = $this->getTempImage();
        $file = $_FILES['Filedata'];
        $uploadError = Nip_File_System::instance()->getUploadError($file, $image->extensions);

        if (!$uploadError) {
            $image->setResourceFromUpload($file);
            if ($image->validate()) {
                $image->resize();
                $image->save();

                $imageCrop = $this->getTempImage();
                $imageCrop->copyResource($image);

                $ratio = $imageCrop->getRatio();
                $max_width = $imageCrop->minWidth > 600 ? $imageCrop->minWidth : 600;
                $heightCalculated = round($max_width / $ratio);
                if ($heightCalculated < $imageCrop->minHeight) {
                    $max_width = round($imageCrop->minHeight * $ratio);
                }

                $imageCrop->max_width = $max_width;
                $imageCrop->setName('crop-' . $image->name);
                $imageCrop->resize();
                $imageCrop->save();

                return $imageCrop;
            } else {
                $this->errors['upload'] = 'Eroare dimensiuni.';
            }
        } else {
            $this->errors['upload'] = $uploadError;
        }


        return false;
    }
483206
public function getTemporaryDirectory()
    {
        if (!self::$_temporary_directory)
        {
            $result     = false;
            $candidates = array(
                ini_get('upload_tmp_dir'),
                JFactory::getApplication()->getCfg('tmp_path'),
                JPATH_ROOT.'/tmp'
            );

            if (function_exists('sys_get_temp_dir')) {
                array_unshift($candidates, sys_get_temp_dir());
            }

            foreach ($candidates as $folder)
            {
                if ($folder && @is_dir($folder) && is_writable($folder))
                {
                    $result = rtrim($folder, '\\/');
                    break;
                }
            }

            if ($result === false) {
                throw new RuntimeException('Cannot find a writable temporary directory');
            }

            self::$_temporary_directory = $result;
        }

        return self::$_temporary_directory;
    }
275589
public function newUpload()
    {
        if (null === $this->getFile()) {
            return null;
        }

        $this->moveFile();

        return $this->getUploadRootDir() . $this->path;
    }
517678
public function finishUploading() {
        $request = array(
            'url' => $this->url,
            'method' => 'post',
            'timeout' => $this->timeoutMs / 1000,
            'data' => array(
                'op' => 'upload_slice_finish',
                'session' => $this->session,
                'filesize' => $this->fileSize,
            ),
            'header' => array(
                'Authorization: ' . $this->signature,
            ),
        );

        $response = $this->sendRequest($request);
        if ($response === false) {
            return false;
        }

        $this->accessUrl = $response['data']['access_url'];
        $this->resourcePath = $response['data']['resource_path'];
        $this->sourceUrl = $response['data']['source_url'];

        return true;
    }
1132793
public function getTempPath()
    {
        if (is_null($this->_tempPath)) {
            $this->_tempPath = sys_get_temp_dir();
        }
        if (!is_dir($this->_tempPath)) {
            @mkdir($this->_tempPath, 0755, true);
            if (!is_dir($this->_tempPath)) {
                throw new Exception("Unable to create temporary path folder {$this->_tempPath}");
            }
        }

        return $this->_tempPath;
    }
664447
private function tempDir()
	{
		$tempPath = tempnam($this->tmp, 'elFinder');
		if (!$tempPath) {
			$this->setError(elFinder::ERROR_CREATING_TEMP_DIR, $this->tmp);
			return false;
		}
		$success = unlink($tempPath);
		if (!$success) {
			$this->setError(elFinder::ERROR_CREATING_TEMP_DIR, $this->tmp);
			return false;
		}
		$success = mkdir($tempPath, 0700, true);
		if (!$success) {
			$this->setError(elFinder::ERROR_CREATING_TEMP_DIR, $this->tmp);
			return false;
		}
		return $tempPath;
	}
916533
public function getTemporaryDirectory()
    {
        $temp = Config::get('concrete.filesystem.temp_directory');
        if ($temp && @is_dir($temp)) {
            return $temp;
        }

        if (!is_dir(DIR_FILES_UPLOADED_STANDARD . '/tmp')) {
            @mkdir(DIR_FILES_UPLOADED_STANDARD . '/tmp', Config::get('concrete.filesystem.permissions.directory'));
            @chmod(DIR_FILES_UPLOADED_STANDARD . '/tmp', Config::get('concrete.filesystem.permissions.directory'));
            @touch(DIR_FILES_UPLOADED_STANDARD . '/tmp/index.html');
        }

        if (is_dir(DIR_FILES_UPLOADED_STANDARD . '/tmp') && is_writable(DIR_FILES_UPLOADED_STANDARD . '/tmp')) {
            return DIR_FILES_UPLOADED_STANDARD . '/tmp';
        }

        if ($temp = getenv('TMP')) {
            return str_replace(DIRECTORY_SEPARATOR, '/', $temp);
        }
        if ($temp = getenv('TEMP')) {
            return str_replace(DIRECTORY_SEPARATOR, '/', $temp);
        }
        if ($temp = getenv('TMPDIR')) {
            return str_replace(DIRECTORY_SEPARATOR, '/', $temp);
        }

        $temp = @tempnam(__FILE__, '');
        if (file_exists($temp)) {
            unlink($temp);

            return str_replace(DIRECTORY_SEPARATOR, '/', dirname($temp));
        }
    }
692020
public function getCurrentUploadDir()
    {
        if (! isset($this->currentUploadDir)) {
            $modelDir = $this->getIdentifier();
            $this->currentUploadDir = public_path($this->uploadDir).DIRECTORY_SEPARATOR.$modelDir.
                DIRECTORY_SEPARATOR.$this->getKey().DIRECTORY_SEPARATOR;
        }

        return $this->currentUploadDir;
    }
68196
public function getMediumPath() {

		if( isset( $this->medium ) ) {

			return Yii::$app->fileManager->uploadDir . '/' . $this->medium;
		}

		return false;
	}