Paste the file

@param string $type
500300
public function pasteFile($type)
    {
        $this->event(YouweFileManagerEvents::BEFORE_FILE_PASTED);
        $this->resolveImage();
        $this->getDriver()->pasteFile($this->getCurrentFile(), $type);
        $this->event(YouweFileManagerEvents::AFTER_FILE_PASTED);
    }
436402
public function setType(Type\AbstractType $type)
    {
        if ($type instanceof Type\Image && $this->hasFormatters() === false) {
            $this->addFormatter(new Formatter\Image());
            $this->setRowClickDisabled(true);
        }

        $this->type = $type;
    }
436829
public function add($name, $type, $filename = null): void
    {
        if (!isset($this->list[$name])) {
            $lock = new Lock($type, $filename);
            $this->list[$name] = $lock;
        }
    }
853906
private static function imageTypeToExtension($type)
    {
        $type = (int)$type;

        switch ($type) {
            case 2:
                $format = 'JPEG';
                break;

            case 4:
                $format = 'PNG';
                break;

            default:
                $format = 'UNSUPPORTED';
        }
        return $format;
    }
1033132
public function blob( $type = 'PNG' ) {

        $type = strtoupper($type);
        if ( ImageType::GIF == $type ) {

            imagegif( $this->gd );

        } else if ( ImageType::JPEG == $type ) {

            imagejpeg( $this->gd );

        } else if ( ImageType::PNG == $type ) {

            imagepng( $this->gd );

        } else if ( ImageType::WBMP == $type ) {

            imagewbmp( $this->gd );

        } else {
            throw new \Exception( sprintf( 'File type "%s" not supported.', $type ) );
        }
    }
39844
public function addResource($resource, string $type = 'file'): void
    {
        if (is_array($resource)) {
            $this->addResourceArray($resource);
            return;
        }

        if (is_string($resource)) {
            switch ($type) {
                case 'json':
                    $this->addResourceString($resource);
                    break;
                case 'file':
                    $this->addResourceFile($resource);
                    break;
                default:
                    throw new \InvalidArgumentException("Invalid resource type");
            }
        }
    }
421774
public function onAddedToType(TypeInterface &$type)
    {
        parent::onAddedToType($type);

        if ($this->getAddIndex()) {
            $type->addIndex(new Index($this->name));
        }

        $type->addTrait(UpdatedAtInterface::class, UpdatedAtInterfaceImplementation::class)->serialize($this->name);
    }
1256601
public function finalFile($file, $type = 'images') {
		return isset($this->oss[$type]) ? $this->putFileToOss($file['name'], $file['tmp'], $type) : $file['src'];
	}
127787
public function javascriptMinify($file, $type = 'file')
    {
        $file = $this->getFile($file, $type);
        $file = preg_replace(["/\/\/(.*\s+)/", "/;+\}/"], ['', '}'], $file);
        $file = $this->cleanSpaces($file);
        $file = $this->removeComments($file);

        return $file;
    }
22078
public static function format($type)
    {
        switch ($type) {
            case self::TYPE_CREATED:
                return 'Created';

            case self::TYPE_STARTING:
                return 'Starting';

            case self::TYPE_RUNNING:
                return 'Running';

            case self::TYPE_ENDING:
                return 'Ending';

            case self::TYPE_FINISHED:
                return 'Finished';

            case self::TYPE_SUCCESS:
                return 'Success';

            case self::TYPE_FAILURE:
                return 'Failure';

            default:
                return 'Unknown';
        }
    }
184357
public function download($file = null, $type = null, $file_name = null)
    {
        if (!empty($file) && @file_exists($file)) {
            if (is_null($file_name)) {
                $file_name_parts = explode('/', $file);
                $file_name = end( $file_name_parts );
            }
            $this->addHeader('Content-disposition', 'attachment; filename='.$file_name);
            $this->addHeader('Content-Type', 'application/force-download');
            $this->addHeader('Content-Transfer-Encoding', $type);
            $this->addHeader('Content-Length', filesize($file));
            $this->addHeader('Pragma', 'no-cache');
            $this->addHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0, public');
            $this->addHeader('Expires', '0'); 
            $this->renderHeaders();
            readfile( $file );
            exit;
        }
        return;
    }
300014
public function run($type = 'all')
    {
        $cleanDivision = false;
        $this->stdout("clean {$type}:\n", Console::FG_GREEN);
        switch ($type) {
            case 'all':
                foreach ($this->ipv4->getQueries() as $name => $query) {
                    if (DatabaseQuery::is_a($query)) {
                        $cleanDivision = true;
                    }
                    $this->clean($query, $name);
                }
                break;
            case 'file':
                foreach ($this->ipv4->getQueries() as $name => $query) {
                    if (FileQuery::is_a($query)) {
                        $this->clean($query, $name);
                    }
                }
                break;
            case 'database':
                foreach ($this->ipv4->getQueries() as $name => $query) {
                    if (DatabaseQuery::is_a($query)) {
                        $cleanDivision = true;
                        $this->clean($query, $name);
                    }
                }
                break;
            default:
                $this->stderr("Unknown type \"{$type}\".", Console::FG_GREY, Console::BG_RED);
                break;
        }
        if ($cleanDivision) {
            $this->cleanDivision();
        }
    }
951073
public function addCredential($type)
    {
        $this->data_type = $type;

        $this->setTitleEditCredential();
        $this->setBreadcrumbEditCredential();

        $this->credential->callHandler($type, 'edit');
    }
747894
public function type($type)
    {
        $type = strtoupper($type);
        if (!in_array($type, ['CURL', 'SOCKET', 'FILE'])) {
            $type = 'CURL';
        }
        $this->def['type'] = $type;
        return $this;
    }
1264668
public function saveAs($output = null, $type = null) {
        $this->setRealType($type);
        if (!is_null($output)) {
            $output = (string)$output;
        }
        return call_user_func('image'.$this->realType, $this->image, $output);
    }
661525
public function flush($file_content = null, $type = null)
    {
        if (!empty($file_content)) {
            if (empty($type)) {
                $finfo = new \finfo();
                $type = $finfo->buffer($file_content, FILEINFO_MIME);
            }
            $this->addHeader('Content-Type', $type);
            $this->renderHeaders();
            echo $file_content;
            exit;
        }
        return;
    }
1126651
protected function installFiles(string $type, string $dst, bool $compile = true, bool $forceLower = false, array $extReplace = [])
    {
        if (!$this->optionSet(strtolower($type))) {
            $this->info("Skipping {$type}", OutputInterface::VERBOSITY_VERBOSE);
            return;
        }

        $this->info("Installing {$type}...");

        $templates = $this->getFiles($forceLower ? strtolower($type) : $type);

        foreach ($templates as $dir => $files) {
            $this->copyTemplates($dir, $files, $dst, $extReplace, $compile);
        }
    }