frostealth / yii2-aws-s3

An Amazon S3 component for Yii2
MIT License
91 stars 56 forks source link

Call to undefined function GuzzleHttp\Psr7\try_fopen() #44

Open odilov-sh opened 3 years ago

odilov-sh commented 3 years ago

I am trying to upload file to amazon, but I got this error

Call to undefined function GuzzleHttp\Psr7\try_fopen()

vendor\frostealth\yii2-aws-s3\src\handlers\UploadCommandHandler.php line 48

My code:

$result = $s3->commands()->upload('e:\Video\short videos\The Small Business Story – short video no captions.mp4', '/uplod/29/10/small.mp4')->withAcl('private')->execute();

How can I fix that?

cozumel424 commented 3 years ago

See #43

Levon770 commented 2 years ago

Is there any reason, that this issue still exist?

ExpandXSoln commented 9 months ago

Change lines 47 through 51 with following code

if (is_string($source)) {
            $source = Psr7\Utils::tryFopen($source, 'r+');
        }

        return Psr7\Utils::streamFor($source);

in UploadCommandHandler file. It was fixed, but again it has reappeared breaking production systems, can someone fix it for good?