Open eugene-chernyshenko opened 4 years ago
please show you config file (dont forgot hide credencials)
'controllerMap' => [
'elfinder' => [
'class' => 'mihaildev\elfinder\PathController',
'access' => ['@'],
'root' => [
'class' => 'mihaildev\elfinder\flysystem\Volume',
'url' => 'https://' . getenv('S3_BUCKET') .'.ams3.digitaloceanspaces.com/files',
'component' => [
'class' => 'creocoder\flysystem\AwsS3Filesystem',
'key' => getenv('S3_ACCESS_KEY'),
'secret' => getenv('S3_ACCESS_SECRET'),
'bucket' => getenv('S3_BUCKET'),
'region' => getenv('S3_REGION'),
// 'version' => 'latest',
// 'baseUrl' => 'your-base-url',
'prefix' => 'files',
'options' => [
"ACL" => "public-read",
],
'endpoint' => getenv('S3_ENDPOINT'),
],
],
],
],
"require": {
"php": ">=7.0",
...
"mihaildev/yii2-elfinder": "*",
"mihaildev/yii2-ckeditor": "*",
"creocoder/yii2-flysystem": "0.9.4 as 0.8.1",
"mihaildev/yii2-elfinder-flysystem": "*"
},
I had to hack a yii2-flysystem version using alias cause there is no way to set s3 endpoint in 0.8.1 version but 0.9.4 brokes dependencies
@MihailDev any ideas?
fix version https://github.com/MihailDev/yii2-elfinder-flysystem/commit/74227f5725ba7ceb5f8f46944a45ce156516c94e
i dont test all drivers but I think you need to configure the baseUrl parameter for the component
sorry for the long answer i have health problems. If you solve the problem, write how you will do it. Thanks in advance.
I get invalid path to file uploading file to s3
Steps to reproduce:
You will get a link like "/elfinder/connect?path=&_csrf=0OgzayMV76bwOyMdP1pBN6nkEa-FGrPo6iAZh7lLemjimF0obkCV4KhPbmxyFght3oZk7bVK0YOoZUHP1xRPWA%3D%3D&cmd=file&target=fls1_enhjLnR4dA"
But if you do these steps without uploading you will get expected link