src/Command/UploadFileCommand.php
/**
     * Upload file from remote URL.
     */
Upload file from remote URL.
Upload file from remote URL .
protected function asUrl(string $path, InputInterface $input, OutputInterface $output): void
    {
        $io = new SymfonyStyle($input, $output);
        $io->title(\sprintf('Try to upload <info>%s</info> from url', $path));
        try {
            $result = $this->api->uploader()->fromUrl($path, $input->getOption('mime-type'), $input->getOption('filename'), $input->getOption('store'));
        } catch (\Exception $e) {
            throw new RuntimeException($e->getMessage());
        }
        $io->success('File uploaded');
        $this->renderFileInfo($result, $io);
    }
protected function asUrl ( string $ path , InputInterface $ input , OutputInterface $ output ) : void { $ io = new SymfonyStyle ( $ input , $ output ) ; $ io -> title ( \ sprintf ( 'Try to upload <info>%s</info> from url' , $ path ) ) ; try { $ result = $ this -> api -> uploader ( ) -> fromUrl ( $ path , $ input -> getOption ( 'mime-type' ) , $ input -> getOption ( 'filename' ) , $ input -> getOption ( 'store' ) ) ; } catch ( \ Exception $ e ) { throw new RuntimeException ( $ e -> getMessage ( ) ) ; } $ io -> success ( 'File uploaded' ) ; $ this -> renderFileInfo ( $ result , $ io ) ; }
Upload file from remote URL.
Upload file from remote URL .