Coder Social home page Coder Social logo

大文件如何上传 about flysystem-cos HOT 3 OPEN

overtrue avatar overtrue commented on July 1, 2024
大文件如何上传

from flysystem-cos.

Comments (3)

vzina avatar vzina commented on July 1, 2024

重写一下方法吧,组件是一次性把文件读取出来再上传的,所以这里需要修改一下

use League\Flysystem\Config;
use Overtrue\Flysystem\Cos\CosAdapter as OCosAdapter;

class CosAdapter extends OCosAdapter
{
    /**
     * @param string   $path
     * @param resource $resource
     * @param Config   $config
     *
     * @return array|false
     */
    public function writeStream($path, $resource, Config $config)
    {
        $options = $this->getUploadOptions($config);

        return $this->getClient()->upload($this->getBucket(), $path, $resource, $options['params']);
    }
}

from flysystem-cos.

ruoshuiyx avatar ruoshuiyx commented on July 1, 2024

我直接换腾讯的sdk了...

from flysystem-cos.

vzina avatar vzina commented on July 1, 2024

也挺好的,我那个是2.0版本的,所以改下那个方法就行了,3.0的貌似也是这个问题,stream_get_contents这个操作限制了

from flysystem-cos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.