'how to upload excel file using http multipart/form-data in yapi

I am develop an excel import app using Java 8 Spring Boot, on the server side, I define the parse rest http entry like this:

@PostMapping("/list")
Response<SparkUserImportResponse> orgUserImport(@RequestBody MultipartFile file,
                                                @RequestParam(required = false,value = "override",defaultValue = "false") Boolean override);

on the client side, I am using Postman and yapi. On the postman Version 9.6.1 (9.6.1), I can select the excel in the UI like this:

enter image description here

I can see the curl command like this in the postman:

curl --location --request POST 'https://admin.example.com/soa-org/service/report/org/user/import/list' \
--header 'token: 0e3a2907d3b9490eae2c1ea4726c9de7' \
--form 'file=@"/path/to/file"'

so I want to do it in the yapi too, I configure in the yapi like this:

enter image description here

seems did dot work as expect. is it possible to do the same thing as postman? is it possible to upload excel file by setting the file path @/Users/dolphin/Downloads/user-import-template-dict.xlsx in the yapi post body? why the postman works but the yapi did not work? just because the postman was client app and yapi was based on the google chrome?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source