[英]Digitalocean Spaces Laravel App - Missing region
I am getting the following error:我收到以下错误:
Missing required client configuration options: region: (string) A “region” configuration value is required for the “s3” service (e.g., “us-west-2”).
Here is my setup (XXX to hide my creds):这是我的设置(XXX 隐藏我的信用):
.env file: .env 文件:
DO_SPACES_KEY=XXXXX
DO_SPACES_SECRET=XXXX
DO_SPACES_ENDPOINT=https://nyc3.digitaloceanspaces.com
DO_SPACES_REGION=NYC3
DO_SPACES_BUCKET=XXXX
filesystems.php file (under the disks): filesystems.php 文件(在磁盘下):
'do_spaces' => [
'driver' => 's3',
'key' => env('XXXXX'),
'secret' => env('XXXXX'),
'endpoint' => env('https://nyc3.digitaloceanspaces.com'),
'region' => env('NYC3'),
'bucket' => env('XXXXXX'),
],
Also in filesystems.php file:同样在 filesystems.php 文件中:
‘cloud’ => env('FILESYSTEM_CLOUD’, 'do_spaces’),
in the view file:在视图文件中:
function addDocument(Request $req, $projId)
{
$image = $req->file('uploadFile');
$file_name = pathinfo($image->getClientOriginalName(), PATHINFO_FILENAME);
$input['imagename'] = $file_name.'_'.time().'.'.$image->getClientOriginalExtension();
//$destinationPath = public_path('/images');
//$image->move($destinationPath, $input['imagename']);
$destinationPath = $image->store('/', 'do_spaces');
Storage::setVisibility($destinationPath, 'public');
//$data = array('fid'=>$folderId,'fileLoc'=>$input['imagename'],'projId'=>$projId);
//\DB::table('documents')->insert($data);
return back();
}
As you can see in the view, I try to store the image on the space and then store the path in the DB which would represent the path to the space.正如您在视图中看到的,我尝试将图像存储在空间中,然后将路径存储在代表空间路径的数据库中。
I cannot get this error to go away;我无法将此错误发送给 go; do you see any issues?
你有什么问题吗?
Thanks!谢谢!
'region' => env('NYC3'),
should be 'region' => env('DO_SPACES_REGION'),
'region' => env('NYC3'),
应该是'region' => env('DO_SPACES_REGION'),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.