We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在文件上传中,使用final formData = FormData.fromMap({ 'file': MultipartFile.fromBytes(file.bytes!), }); 进行单文件上传,会将file自动塞入files字段中。导致后端无法解析到file字段。 能否添加一个标志,表示是否自动将file转化为files 这是dio FormData中的代码 if (fromMap != null) { // Use [encodeMap] to recursively add fields and files. // TODO(Alex): Write a proper/elegant implementation. encodeMap( fromMap, (key, value) { if (value is MultipartFile) { files.add(MapEntry(key, value)); } else { fields.add(MapEntry(key, value?.toString() ?? '')); } return null; }, listFormat: listFormat, encode: false, ); }
No response
The text was updated successfully, but these errors were encountered:
Please submit issues using the correct issue template.
Sorry, something went wrong.
No branches or pull requests
Request Statement
在文件上传中,使用final formData = FormData.fromMap({
'file': MultipartFile.fromBytes(file.bytes!),
});
进行单文件上传,会将file自动塞入files字段中。导致后端无法解析到file字段。
能否添加一个标志,表示是否自动将file转化为files
这是dio FormData中的代码
if (fromMap != null) {
// Use [encodeMap] to recursively add fields and files.
// TODO(Alex): Write a proper/elegant implementation.
encodeMap(
fromMap,
(key, value) {
if (value is MultipartFile) {
files.add(MapEntry(key, value));
} else {
fields.add(MapEntry(key, value?.toString() ?? ''));
}
return null;
},
listFormat: listFormat,
encode: false,
);
}
Solution Brainstorm
No response
The text was updated successfully, but these errors were encountered: