Skip to content

UploadedFile List not being passed to api calls.  #503

@ISHA7782

Description

@ISHA7782

Issue tracker is ONLY used for reporting bugs. New feature suggestions and questions should be discussed on Community or submitted through our user feedback form.

Your issue may already be reported! Please search in the issue tracker before creating one.

Please thumbs up this issue if you have also experienced it. You may also add more information if there is something relevant that was not mentioned. However, please refrain from comments that are not constructive, like "I have this problem too", etc.

Expected behavior (required)

With flutter flow, We should be able to pass multiple uploaded files to api server.

Current behavior (required)

From App UI , I am trying to pass uploaded file list to API.
My api call is receiving "[]" as req input, instead of files. My api type is multipart.
Same call is working from postman.

To Reproduce (required)

For example, "project fails to build" could be better reported as:

  1. Create Multipart API call with one of input as list of uploadedFile
  2. Try adding action from any widget, and call the api.
  3. Check the request input using developer/inspect tools
  4. API request uploaded file list is always []

Bug Report Code (required, generate by right clicking inside Widget Tree and clicking "Get Bug Report Code")

Not related to particular widget, related to action -

ITEek/H15c9NtbxI+qn2bsFFmQMwGkQ5a7sviu5+FBQaI+KvEYouf8zCYRZWcuqHY2xYIlWWgkEH/96LjuHLEsEFEEycR7U4/5FtH1yjEA8=

Context (required)

  • Prod scenario for one of the project to upload multiple files, blocking the release.

Screenshots / recordings

Chrome requests -

Screen Shot 2023-02-17 at 11 50 59 AM

Postman call succeed

Screen Shot 2023-02-17 at 11 31 16 AM

Your environment

  • Version of FlutterFlow used: Latest 3.7.3
  • Platform (e.g. Web, MacOS Desktop): MAC Version 12.5
  • Browser name and version: CHROME Version 108.0.5359.124 (Official Build) (arm64)
  • Operating system and version (desktop or mobile): desktop

Here is the my analysis on the issue -

Things work if i pass single file rather than list.
So, when flutterflow is generating a code with list, it calling the _serializeList

This is code from
api_calls.dart - final projectAssets = _serializeList(projectAssetsList);
As part of this method, always [] is returned.

Method -

String _serializeList(List? list) {
list ??= <String>[];
try {
return json.encode(list);
} catch (_) {
return '[]';
}
}

json.encode wont work , as the we need to call the serialize with custom file type.

May be something like this

final projectAssets =
        serializeParam(projectAssetsList, ParamType.FFUploadedFile, true);

My project ID - https://app.flutterflow.io/project/edith-q53ple

page - AddProject.

project build - https://app.flutterflow.io/run/IXcYKEjjhwRUe2abg5Qv

Metadata

Metadata

Labels

status: can't reproduceFollowing the reported steps did not reproduce the bug.status: needs informationMore information/context is needed for assessment.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions