如何从 Flutter 上传文件到 Wasabi

How to upload files to Wasabi from Flutter

我目前正在开发一个应用程序,我想将视频和图像上传到 Flutter 中的 Wasabi s3 存储桶。我第一次尝试使用 amplify_flutter, but this did not work because as detailed in their setup guide 我需要登录 Amazon Web Services 才能配置包。

我确实发现另一个堆栈溢出 answer describing how to upload to AWS with an https request. copying this code did give me the ability to connect with https://s3.wasabisys.comm,但是当使用 POST 请求上传文件时, url returns 这个错误信息:

<Error><Code>MethodNotAllowed</Code><Message>The specified method is not allowed against this 
resource.</Message><RequestId>9E0DDF6269E6C862</RequestId>
<HostId>rLX8KeJ9ZPbk6+Zy+GvXUgG1f8ffJ8cNK92KUBnd8DLruqbWbX7dWyKy37N4IoHtqp41+ctRVEBC</HostId></Error>

我确实在 AWS 论坛上找到了描述相同问题的 post,他们说需要启用“CloudFront Origin Access Identity”,但由于我也没有使用 CloudFront,所以启用它我无法选择。

在 Wasabi 中,是否有一个类似于“CloudFront Origin Access Identity”的选项,我可以启用它以允许 POST 对存储桶的请求,或者在 Flutter 中是否有更好的选项来上传到 Wasabi s3 桶?

更新:我可以使用 Minio flutter 包解决这个问题。我们已经使用这个软件包几个星期了,连接到 Wasabi 没有任何问题。