我看到很多关于如何将文件上传到S3的文档,但我的问题有点逆转。我有一个流星应用程序,我在其中设置了collectionFS
。现在,我的应用程序中的每个文档都有一个带有标题图像的S3存储桶。我如何为单个文档引用它? (如果有帮助,每个文档的slug
对应于存储桶中的图像标题slug.jpg
。
到目前为止我已经
了var imageStore = new FS.Store.S3("careerImages", {
// region: "my-s3-region", //optional in most cases
accessKeyId: "my-value", //required if environment variables are not set
secretAccessKey: "my-value", //required if environment variables are not set
bucket: "ryf2.5", //required
// ACL: "myValue", //optional, default is 'private', but you can allow public or secure access routed through your app URL
folder: "header_images", //optional, which folder (key prefix) in the bucket to use
// The rest are generic store options supported by all storage adapters
// transformWrite: myTransformWriteFunction, //optional
// transformRead: myTransformReadFunction, //optional
// maxTries: 1 //optional, default 5
});
CareerImages = new FS.Collection("careerImages", {
stores: [imageStore]
});
现在我只想找到一种方法在我的模板中显示它们。