Azure Blob Storage upload fails on Android - with solution

Open Beginner friendly
#200 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
64/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
dart, java
Domain
mobile

Research direction

Start in UploadWorker.java around line 142 and compare how the Android implementation builds the request body with the issue's proposed change. Check the Flutter and iOS upload paths for the expected header behavior, then verify that Azure Blob Storage accepts Android uploads without the header being modified.

Written by the indexing model from the issue text.

Description

Hi there! The Android implementation changes the header – causing services like the Azure blob storage to reject uploads as the header is modified. The iOS implementation does not do this. In my opinion the header should only be set in the Flutter code.

Our solution was to just modify line 142 in UploadWorker.java:

innerRequestBody = RequestBody.create(file, contentType);

to

innerRequestBody = RequestBody.create(file, null);

Maybe this helps somebody.

Dominant language
Dart
Stars
217
Forks
172
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fluttercommunity/flutter_uploader

All issues in fluttercommunity/flutter_uploader

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.