yii2-aws-s3 icon indicating copy to clipboard operation
yii2-aws-s3 copied to clipboard

Call to undefined function GuzzleHttp\Psr7\try_fopen()

Open odilov-sh opened this issue 4 years ago • 3 comments

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?

odilov-sh avatar Oct 29 '21 10:10 odilov-sh

See #43

cozumel424 avatar Oct 30 '21 03:10 cozumel424

Is there any reason, that this issue still exist?

Levon770 avatar Aug 28 '22 08:08 Levon770

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?

ExpandXSoln avatar Feb 04 '24 15:02 ExpandXSoln