Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatar upload not working when using flysystem AwsS3Filesystem as filesystemComponent #371

Open
iadj opened this issue Feb 17, 2016 · 0 comments

Comments

@iadj
Copy link

iadj commented Feb 17, 2016

In my yii2-starter-kit installation, I configured the fileStorage module to use creocoder\flysystem\AwsS3Filesystem (which now has a pull request that supports S3 v3) as filesystemComponent.

I haven't touched any code except for common/config/base.php, setting a awss3Fsmodule:

    'awss3Fs' => [
       'class' => 'creocoder\flysystem\AwsS3Filesystem',
       'key' => getenv('S3_KEY'),
       'secret' => getenv('S3_SECRET'),
       'bucket' => getenv('S3_BUCKET'),
       'region' => 'us-east-1',
     ],

and fileStorage module:

    'fileStorage' => [
        'class' => '\trntv\filekit\Storage',
        'filesystemComponent'=> 'awss3Fs',

        'as log' => [
            'class' => 'common\behaviors\FileStorageLogBehavior',
            'component' => 'fileStorage'
        ]
    ],

When I try to upload an avatar using the standard avatar-upload action in modules/user/controllers/DefaultController.php, I get the following error:
exception 'yii\base\ErrorException' with message 'fstat() expects parameter 1 to be resource, integer given' in vendor\league\flysystem\src\Util.php:256

How can I fix this issue?

@iadj iadj changed the title Avatar upload not working when using AwsS3Filesystem as filesystemComponent Avatar upload not working when using flysystem AwsS3Filesystem as filesystemComponent Feb 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants