【问题标题】:AWS amplify adding files in public directoryAWS放大在公共目录中添加文件
【发布时间】:2021-03-22 04:51:04
【问题描述】:

当我在放大选项中提供密钥时,我正在使用 AWS 放大在 s3 存储桶中上传视频,它创建一个公共文件夹然后获取该密钥。

Amplify.Storage.uploadFile(
            "user/hello/123321.mp4",
            exampleFile,
            result -> Log.i("MyAmplifyApp", "Successfully uploaded: " + result.getKey()),
            storageFailure -> Log.e("MyAmplifyApp", "Upload failed", storageFailure)
    );

s3 桶进入内部 - public/user/hello/123321.mp4

我只想让我的文件进入密钥,而不是创建任何公用文件夹。

有什么选择吗?

【问题讨论】:

标签: amazon-web-services amazon-s3 aws-amplify


【解决方案1】:

试试:

Storage.put(
"file name", 
file (actual file from input) ,
{
level: "public", 
customPrefix: {public: "folder name in S3 /"},
})

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-20
    • 2020-10-03
    • 2021-03-18
    • 1970-01-01
    相关资源
    最近更新 更多