0

I am attempting to implement the ability to upload multiple images (along with some other data) to an API using data entered via a form on my flutter application.

I am using https://pub.dev/packages/multi_image_picker which stores all the images as a List<Asset>

The API I am attempting to connect with says it requires the following fields.

firstname, lastname and images[].

I have started to encode the json body using:

var body = json.encode({"firstname": firstNameField, "lastname": lastNameField, "images": imageList});

but this failed. Does anyone have any suggestions?

1
  • What error message are you seeing? Consider reading this article about serialization in flutter Commented Sep 5, 2019 at 6:08

1 Answer 1

2

Hey @Bollie, You can do using the flutter_uploader package, it's very simple you can post your data in formdata separately with multiple files/images. here is more info on how you can do,Hope it'll work for you.. https://github.com/BlueChilli/flutter_uploader/issues/9

  • feel free to ask any questions regarding this, Actually I recently did it so...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.