从Cloudinary切换到S3 – 无法上传

我有一个KeystoneJS项目,将从Cloudinary切换到S3。 该项目与Cloudinary开箱即用。 但是,我们想迁移到使用S3进行存储。

我目前有S3在我的keystone.js文件中设置:

 var config = require('./config.json'); keystone.set('s3 config', { bucket: config.s3.bucket, key: config.s3.key, secret: config.s3.secret }); 

我有另一个叫做Page模型,我想用上传图片。 有一个名为heroImage的字段,以前是一个简单的{ type: Types.Cloudinary }

但是,为了使用S3,我必须将其更改为:

 heroImage: { type: Types.S3File, format: function(item, file) { return '<img src="' + file.url + '" style="max-width: 300px">'; } } 

进入AdminUI时,一切都很好。 我可以点击Upload File ,按下Save ,我收到一条成功消息。 我用传输检查了S3存储桶,发现这个文件从未上传过。 另外,去文件URL显示这个:

 <Error> <Code>PermanentRedirect</Code> <Message> The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. </Message> <Bucket>MY_BUCKET</Bucket> <Endpoint>MY_BUCKET.s3.amazonaws.com</Endpoint> <RequestId>5CBD0F317C517254</RequestId> <HostId> VCoEc5PFevAecvyYC79ta7CIzWBewQ90kribJ59NAQ5JHn8dNEwMV+Ncv9cSfT1l </HostId> </Error> 

任何帮助从Cloudinary切换到S3将不胜感激。

我只是不得不删除任何. 来自S3存储桶名称。 例如,我只是将其重命名为bucketnamecms而不是bucketnamecms