-1

I have a scenario in flutter where I have to make an upload to s3 given the pre signed URL by server. Once I tried to make the request to presigned URL the call doesn't get resolved and it remains in pending state for ever no issue nothing. Making the put Request using the same signedURL from postman just works fine. Additionally my server is accepting only 'video/mp4' files. Should the BE guy has to change the content Type for presigned URL to octet stream. Any help would be highly appreciated on this

Expecting to successfully made a upload call using put method from http, by appending the file to the request using bodyAsByte param

1 Answers1

0

Their could be few reason:-

  • In your case, the Content-Type header should be set to the specific MIME type of the file you're uploading. ( video/mp4 )
  • As you mention bodyAsBytes. Although it's a correct way to send binary data to a server (and then from the server to S3), So make sure you're passing the correct bytes of the video file.
  • As you use pre-signed URL make sure their are no CORS policy issues when you make a request.
  • Double-check the CORS policy issue from both sides. Flutter App's domain and also from the server-side.
Kayes
  • 51
  • 6