How to upload files to Wasabi from Flutter

376

Update: I was able to solve this by using the Minio flutter package. We have been using this package for a couple weeks now without any issue to connect to Wasabi.

Share:
376
Admin
Author by

Admin

Updated on December 02, 2022

Comments

  • Admin
    Admin over 1 year

    I am currently working on an application where I would like to upload videos and images to a Wasabi s3 bucket in Flutter. I first attempted to use amplify_flutter, but this did not work because as detailed in their setup guide I am required to log into Amazon Web Services in order to configure the package.

    I did find another stack overflow 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, but when using a POST request to upload the files, the url returns this error message:

    <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>
    

    I did find a post on the AWS forums describing the same issue, and they stated that a "CloudFront Origin Access Identity" needs to be enabled, but since I am not using CloudFront either, enabling this option is not possible for me.

    In Wasabi, is there an option similar to "CloudFront Origin Access Identity" that I can enable in order to allow POST requests to a bucket, or is there a better option in Flutter to upload to Wasabi s3 buckets?