我正在尝试连接AWS S3以存储目录9的文件。无法找到任何关于如何编辑.env文件的信息。
以下是我在.env中的文件存储设置
####################################################################################################
### 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
提前谢谢。
发布于 2022-08-30 11:14:29
我设法通过以下代码开始工作:
更改:
STORAGE_LOCATIONS
####################################################################################################
### 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=https://stackoverflow.com/questions/73541297
复制相似问题