Before use, you need to register an account in Alibaba link
Object storage is an encrypted and secure cloud storage service, no matter where the user is, it is easy to master, store, process and access massive amounts of data.
How to install?
-
- in your project root
php artisan plugin:install jc91715.oss
- in your project root
-
- or use Git
git clone https://github.com/jc91715/oc-plugin-oss.git project/plugins/jc91715/oss
then run
composer install
- or use Git
Config in config/filesystems.php
'disks' => [ 'oss_file' => [ 'driver' =>'oss' ] ]
in backend
How to use?
\Storage::disk('oss_file')->put('test.txt','Hello OSS');
or
$file=$request->file('file'); $file->storeAs($relativeDir, $filename, 'oss_file'); //$relativeDir is directory
storage extend for aliyun oss
Installation
php artisan plugin:install jc91715.oss
Put content to file config/filesystems.php
in disks array
'oss_file' => [ 'driver' => 'oss', ],
Config in backend
Store
\Storage::disk('oss_file')->put("test.txt","hello oss")
-
yangzie
Found the plugin not useful on 6 Jan, 2019
The error is show when I request this url "backend/system/updates",InvalidArgumentException: Driver [oss] is not supported. in /data/wwwroot/yzbackend/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php:126
-
mike
Found the plugin useful on 3 Oct, 2018
yes can not view the resource at backend
-
taoguang
Found the plugin useful on 30 Sep, 2018
I wrote the storage under config\cms.php, 'storage' => [ 'uploads' => [ 'disk' => 'oss_file', 'folder' => 'uploads', 'path' => 'https://mybucket.oss-cn-beijing.aliyuncs.com/uploads', ], 'media' => [ 'disk' => 'oss_file', 'folder' => 'media', 'path' => 'https://mybucket.oss-cn-beijing.aliyuncs.com/media', ], ],
There is no problem with the upload part. But the media cannot see the uploaded image in backend.
-
1.0.1 |
First version of oss Apr 18, 2018 |
---|
v1.1.1