我想使用自己的 S3 存储并显示刚刚上传的图像。如何获取上传到 S3 的文件名?例如,我可以将 jpg 图像上传到 UploadCare。这是我可以得到的输出: fileInfo.cdnUrl: "https://ucarecdn.com/6314bead-0404-4279-9462-fecc927935c9/" fileInfo.name: "0 (3).jpg"
但如果我检查我的 S3 存储桶,这是实际上传到 S3 的文件名:https ://localdevauctionsite-us.s3.us-west-2.amazonaws.com/6314bead-0404-4279-9462-fecc927935c9/03 .jpg
这是我到目前为止的javascript:
var widget = uploadcare.Widget('[role=uploadcare-uploader]');
widget.onChange(group => {
group.files().forEach(file => {
file.done(fileInfo => {
// Try to list the file from aws s3
console.log('CDN url:', fileInfo.cdnUrl);
//https://uploadcare.com/docs/file_uploader_api/files_uploads/
console.log('File name: ', fileInfo.name);
});
});
});