上传到AWS S3时,Strapi损坏了图像
我安装了AWS S3作为我的strapi后端的上传提供商:
// path: ./config/plugins.js
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: 'aws-s3',
providerOptions: {
accessKeyId: env('AWS_ACCESS_KEY_ID'),
secretAccessKey: env('AWS_ACCESS_SECRET'),
region: env('AWS_REGION'),
params: {
Bucket: env('AWS_BUCKET'),
},
},
},
},
// ...
});
我不知道该如何解决此问题,因为我是使用Strapi和AWS S3的新手。感谢您的帮助!
I installed aws s3 as an upload provider for my Strapi Backend:
// path: ./config/plugins.js
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: 'aws-s3',
providerOptions: {
accessKeyId: env('AWS_ACCESS_KEY_ID'),
secretAccessKey: env('AWS_ACCESS_SECRET'),
region: env('AWS_REGION'),
params: {
Bucket: env('AWS_BUCKET'),
},
},
},
},
// ...
});
It is connected to aws s3 but the image is broken when I uploaded it:
And I still get the image uploaded to aws s3:
I don't know how to fix this because I'm new to using Strapi and AWS S3. Thanks for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要在
./ config/middlewares.js
中替换strapi ::安全字符串,但以下内容:You need to replace strapi::security string in
./config/middlewares.js
with the following:补充我们的朋友上面评论的内容,请从config/midderwares.js文件上删除AWS_Region
。示例文件看起来像这样:
Complementing that our friend commented above,remove AWS_REGION from url on config/middlewares.js file
The example file looks like this: