admin管理员组文章数量:1122846
I’m trying to connect my Laravel application to a Storj.io bucket for file uploads using Laravel’s built-in storage system (Storage::disk()), similar to how I would connect to AWS S3. However, I haven’t been able to get it working, and I’m stuck.
Here’s what I’ve done so far: 1. Environment Configuration: I added the following details to my .env file:
AWS_ACCESS_KEY_ID=my_access_key
AWS_SECRET_ACCESS_KEY=my_secret_key
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=my_storj_bucket
AWS_ENDPOINT=
AWS_USE_PATH_STYLE_ENDPOINT=true
I updated the s3 driver in config/filesystems.php
:
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
],
I wrote a simple file upload function:
$path = $request->file('file')->store('uploads', 's3');
本文标签: phpHow to connect Laravel storage with Storjio bucket for file uploads like S3Stack Overflow
版权声明:本文标题:php - How to connect Laravel storage with Storj.io bucket for file uploads like S3? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736311880a1934899.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论