-
Notifications
You must be signed in to change notification settings - Fork 28
Description
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:
- Create Multipart API call with one of input as list of uploadedFile
- Try adding action from any widget, and call the api.
- Check the request input using developer/inspect tools
- 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 -
Postman call succeed
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

