Comments (6)
You can create your own flysystem builder class.
I'll update docs as soon as possible
from yii2-file-kit.
https://github.com/trntv/yii2-file-kit/blob/master/README.md#using-filesystem-builder
from yii2-file-kit.
Awesome. Thank you for the examples!
from yii2-file-kit.
@trntv I still get the same error as described in yii-starter-kit/yii2-starter-kit#371:
fstat() expects parameter 1 to be resource, integer given
.
Using AwsS3v3FlysystemBuilder
from the examples: https://github.com/trntv/yii2-file-kit/blob/master/examples/AwsS3v3FlysystemBuilder.php
from yii2-file-kit.
update package
0cdc678
from yii2-file-kit.
@trntv Ok, the error is now:
fstat() expects parameter 1 to be resource, object given.
file: "D:\app\vendor\league\flysystem\src\Util.php"
line: 254
Am I doing something wrong? This is my Storage config:
'fileStorage' => [
'class' => '\trntv\filekit\Storage',
'baseUrl' => ' https://s3.amazonaws.com/' . getenv('S3_PROFILE_BUCKET'),
'filesystem' => [
'class' => 'common\components\filesystem\AwsS3v3FlysystemBuilder',
'key'=>getenv('S3_KEY'),
'secret'=>getenv('S3_SECRET'),
'region' => 'us-east-1',
],
'as log' => [
'class' => 'common\behaviors\FileStorageLogBehavior',
'component' => 'fileStorage'
]
AwsS3v3FlysystemBuilder
is like the example.
I can see the file is uploaded to the bucket and correctly added to file_storage_item
. However the 'upload process' in yii2-starter-kit
never seems to finish, and returns the error described above.
Here's a stack trace:
0: "#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'fstat() expects...', 'D:\\app...', 254, Array)"
1: "#1 D:\app\vendor\league\flysystem\src\Util.php(254): fstat(Object(Intervention\Image\Image))"
2: "#2 D:\app\vendor\league\flysystem-aws-s3-v3\src\AwsS3Adapter.php(557): League\Flysystem\Util::getStreamSize(Object(Intervention\Image\Image))"
3: "#3 D:\app\vendor\league\flysystem-aws-s3-v3\src\AwsS3Adapter.php(121): League\Flysystem\AwsS3v3\AwsS3Adapter->upload('1/cD84EtMmnB6CW...', Object(Intervention\Image\Image), Object(League\Flysystem\Config))"
4: "#4 D:\app\vendor\league\flysystem\src\Filesystem.php(96): League\Flysystem\AwsS3v3\AwsS3Adapter->update('1/cD84EtMmnB6CW...', Object(Intervention\Image\Image), Object(League\Flysystem\Config))"
5: "#5 D:\app\vendor\league\flysystem\src\File.php(94): League\Flysystem\Filesystem->put('1/cD84EtMmnB6CW...', Object(Intervention\Image\Image))"
6: "#6 D:\app\frontend\modules\user\controllers\DefaultController.php(41): League\Flysystem\File->put(Object(Intervention\Image\Image))"
7: "#7 [internal function]: frontend\modules\user\controllers\DefaultController->frontend\modules\user\controllers\{closure}(Object(trntv\filekit\events\UploadEvent))"
8: "#8 D:\app\vendor\yiisoft\yii2\base\Component.php(541): call_user_func(Object(Closure), Object(trntv\filekit\events\UploadEvent))"
9: "#9 D:\app\vendor\trntv\yii2-file-kit\src\actions\UploadAction.php(167): yii\base\Component->trigger('afterSave', Object(trntv\filekit\events\UploadEvent))"
10: "#10 D:\app\vendor\trntv\yii2-file-kit\src\actions\UploadAction.php(132): trntv\filekit\actions\UploadAction->afterSave('1/cD84EtMmnB6CW...')"
11: "#11 [internal function]: trntv\filekit\actions\UploadAction->run()"
12: "#12 D:\app\vendor\yiisoft\yii2\base\Action.php(92): call_user_func_array(Array, Array)"
13: "#13 D:\app\vendor\yiisoft\yii2\base\Controller.php(154): yii\base\Action->runWithParams(Array)"
14: "#14 D:\app\vendor\yiisoft\yii2\base\Module.php(454): yii\base\Controller->runAction('avatar-upload', Array)"
15: "#15 D:\app\vendor\yiisoft\yii2\web\Application.php(84): yii\base\Module->runAction('user/default/av...', Array)"
16: "#16 D:\app\vendor\yiisoft\yii2\base\Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))"
17: "#17 D:\app\frontend\web\index.php(22): yii\base\Application->run()"
from yii2-file-kit.
Related Issues (20)
- Bug: Upload widget allow multiples files via drag and drop
- AWS S3 A sha256 checksum could not be calculated
- Javascript events
- single file does not support image preview
- Problem with multi-upload - saved first and last image
- Errors with popover as alternative
- Get rid of bootstrap? HOT 1
- uploadKit with multi sub domain HOT 1
- loading more than 2 files HOT 8
- Enh add config property on save file
- Upload widget does not work with javascript HOT 9
- Maybe somebody can write this widget by vueJs? HOT 1
- It seems trntv\filekit\widget\Upload rendered incorrectly in modal dialog HOT 1
- Upload from Mobile Device Cameras HOT 3
- Image variations HOT 1
- Error message translations HOT 1
- Why after upload file, generate folder "1" ? HOT 2
- How to make dynamic uploadPath ? HOT 2
- How to add seo fields ?
- Upload file not working on Iphone
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-file-kit.