首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >对于AWS S3连接的Directus 9文件存储适配器有任何指南吗?

对于AWS S3连接的Directus 9文件存储适配器有任何指南吗?
EN

Stack Overflow用户
提问于 2022-08-30 10:56:47
回答 1查看 37关注 0票数 1

我正在尝试连接AWS S3以存储目录9的文件。无法找到任何关于如何编辑.env文件的信息。

以下是我在.env中的文件存储设置

代码语言:javascript
复制
####################################################################################################
### File Storage

# A CSV of storage locations (eg: local,digitalocean,amazon) to use. You can use any names you'd like for these keys ["local"]
STORAGE_LOCATIONS="local,S3"
STORAGE_LOCAL_DRIVER="local"
STORAGE_LOCAL_ROOT="./uploads"

## S3 Example (location name: DigitalOcean)
# STORAGE_DIGITALOCEAN_DRIVER="s3"
# STORAGE_DIGITALOCEAN_KEY="abcdef"
# STORAGE_DIGITALOCEAN_SECRET="ghijkl"
# STORAGE_DIGITALOCEAN_ENDPOINT="ams3.digitaloceanspaces.com"
# STORAGE_DIGITALOCEAN_BUCKET="my-files"
# STORAGE_DIGITALOCEAN_REGION="ams3"

## Google Cloud Storage Example (location name: Google)
# STORAGE_GOOGLE_DRIVER="gcs"
# STORAGE_GOOGLE_KEY_FILENAME="abcdef"
# STORAGE_GOOGLE_BUCKET="my-files"

## AWS S3 Storage Settings (My settings)
STORAGE_S3_DRIVER="s3"
STORAGE_S3_KEY="******"
STORAGE_S3_SECRET="*******"
STORAGE_S3_BUCKET="*******"
STORAGE_S3_REGION="ap-south-1"
STORAGE_S3_ENDPOINT="s3.amazonaws.com"
STORAGE_S3_ROOT="/uploads"
#STORAGE_S3_ACL=

注意:'AWS S3存储设置(我的设置)‘是由我设置的AWS S3的设置。

下面的链接是我到目前为止发现的: https://docs.directus.io/getting-started/glossary.html#storage-adapters

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2022-08-30 11:14:29

我设法通过以下代码开始工作:

更改:

STORAGE_LOCATIONS

  • Hide

  • 从 STORAGE_LOCAL_DRIVER和STORAGE_LOCAL_ROOT
  1. Replaced S3中删除了“本地”,亚马逊在“我的设置”中使用了

代码语言:javascript
复制
####################################################################################################
### File Storage

# A CSV of storage locations (eg: local,digitalocean,amazon) to use. You can use any names you'd like for these keys ["local"]
STORAGE_LOCATIONS="amazon"
#STORAGE_LOCAL_DRIVER="local"
#STORAGE_LOCAL_ROOT="./uploads"

## S3 Example (location name: DigitalOcean)
# STORAGE_DIGITALOCEAN_DRIVER="s3"
# STORAGE_DIGITALOCEAN_KEY="abcdef"
# STORAGE_DIGITALOCEAN_SECRET="ghijkl"
# STORAGE_DIGITALOCEAN_ENDPOINT="ams3.digitaloceanspaces.com"
# STORAGE_DIGITALOCEAN_BUCKET="my-files"
# STORAGE_DIGITALOCEAN_REGION="ams3"

## Google Cloud Storage Example (location name: Google)
# STORAGE_GOOGLE_DRIVER="gcs"
# STORAGE_GOOGLE_KEY_FILENAME="abcdef"
# STORAGE_GOOGLE_BUCKET="my-files"

## AWS S3 Storage Settings (My settings)
STORAGE_AMAZON_DRIVER="s3"
STORAGE_AMAZON_KEY="******"
STORAGE_AMAZON_SECRET="*******"
STORAGE_AMAZON_BUCKET="*******"
STORAGE_AMAZON_REGION="ap-south-1"
STORAGE_AMAZON_ENDPOINT="s3.amazonaws.com"
STORAGE_AMAZON_ROOT="/uploads"
#STORAGE_AMAZON_ACL=
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73541297

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档