public function store(UploadedFileSource $file, $folderId, $userId, $originalFileId, $useWizard)
    {
        $tempId = uniqid();
        $tempDir = $this->tempDir.'/'.$tempId.'/';
        $tempName = $tempDir.basename($file->getPath());

        if (!file_exists($tempDir) && !mkdir($tempDir, 0777, true)) {
            throw new StoreUploadedFileException('Error occured while creating temp upload folder.');
        }

        if (!move_uploaded_file($file->getPath(), $tempName)) {
            throw new StoreUploadedFileException('Error occured during uploaded file move.');
        }

        $tempFile = new TempFile(
            $tempId,
            $file->getName(),
            $tempName,
            $file->getMimeType(),
            $file->getSize(),
            $this->hasher->fromPath($tempName),
            $originalFileId,
            $folderId,
            $userId,
            $useWizard
        );

        /*
        $event = new BeforeStoreUploadEvent($this, $tempFile);
        if ($this->dispatcher->dispatch(MediaSiteEvents::BEFORE_STORE_UPLOAD, $event)->isPropagationStopped()) {
            return null;
        }
        */

        $tempFiles = $this->session->get('mediamanager.temp_files');
        $tempFiles[$tempId] = $tempFile;
        $this->session->set('mediamanager.temp_files', $tempFiles);

        /*
        $event = new StoreUploadEvent($this, $tempFile);
        $this->dispatcher->dispatch(MediaSiteEvents::STORE_UPLOAD, $event);
        */

        return $tempFile;
    }