fix fopen

This commit is contained in:
Ashita Prasad
2024-04-14 21:18:32 +05:30
parent 459a9b20ba
commit 1764c373fb
2 changed files with 6 additions and 6 deletions

View File

@ -71,11 +71,11 @@ echo $res->getBody();
if (requestModel.hasFormData) {
var templateMultiPartBody = jj.Template(kTemplateMultiPartBody);
var renderedMultiPartBody = templateMultiPartBody.render({
"fields_list": requestModel.formDataMapList.map((field) {
"fields_list": requestModel.formDataList.map((field) {
var row = '''
[
'name' => '${field['name']}',
'contents' => '${field['value']}'
'name' => '${field.name}',
'contents' => ${field.type == FormDataType.file? "fopen('${field.value}', 'r')":"'${field.value}'"}
]''';
return row;
}).join(",\n"),

View File

@ -573,7 +573,7 @@ $body = new MultipartStream([
],
[
'name' => 'imfile',
'contents' => '/Documents/up/1.png'
'contents' => fopen('/Documents/up/1.png', 'r')
]
]);
@ -610,7 +610,7 @@ $body = new MultipartStream([
],
[
'name' => 'imfile',
'contents' => '/Documents/up/1.png'
'contents' => fopen('/Documents/up/1.png', 'r')
]
]);
@ -694,7 +694,7 @@ $body = new MultipartStream([
],
[
'name' => 'imfile',
'contents' => '/Documents/up/1.png'
'contents' => fopen('/Documents/up/1.png', 'r')
]
]);