Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers Config (Content-Type) #38

Closed
ainulya16 opened this issue Nov 27, 2019 · 8 comments
Closed

Headers Config (Content-Type) #38

ainulya16 opened this issue Nov 27, 2019 · 8 comments

Comments

@ainulya16
Copy link

files is failed to upload after set header of content type to "application/octet-stream".

here is error response below:

flutter: exception: taskId: chillisource.flutter_uploader.upload.background.5, status:UploadTaskStatus(4), statusCode:400, code:upload_error, message:Error in call to API function "files/upload": Bad HTTP "Content-Type" header: "multipart/form-data; boundary=alamofire.boundary.3b1254f2854aa177,application/octet-stream". Expecting one of "application/octet-stream", "text/plain; charset=dropbox-cors-hack".}, tag:upload

@ened
Copy link
Collaborator

ened commented Nov 27, 2019

Hi @ainulya16 please try the new enqueueRaw method in the uploader class.

@ainulya16
Copy link
Author

which version?

@onikiri2007
Copy link
Contributor

try 1.2.0

@ainulya16
Copy link
Author

i did but still same. i am using "enqueue" not enqueueBinary" to upload multiple files.

@ened
Copy link
Collaborator

ened commented Nov 30, 2019

Hi @ainulya16 in that case call enqueueBinary for each of your files. Please check how exactly it endpoints expects the data.

@ainulya16
Copy link
Author

i did it, but seemed this package replace my customer header for "application/octet-stream" or whatever it is.

@spiritinlife
Copy link
Contributor

I had the same issue @ainulya16 . Did this pr if you want to take a look #54
@ened

@ened
Copy link
Collaborator

ened commented Jul 15, 2020

@ainulya16 The PR at #54 got merged. You can test the changes using:

dependency_overrides:
  flutter_uploader:
    git:
      url: https://github.com/BlueChilli/flutter_uploader

@ened ened closed this as completed Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants