最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

spring boot - Upload a file from PowerAutomate to API (HTTPS) in Springboot - Stack Overflow

programmeradmin3浏览0评论

I am uploading a file from Microsoft Powerautomate to Springboot API. Getting exception "errorMsg": "Failed to parse multipart servlet request; nested exception is .apache.tomcat.util.http.fileupload.FileUploadException: Header section has more than 10240 bytes (maybe it is not properly terminated)"
API is working with Postman and Angular framework
API Details

@PostMapping(value = "/v1.0/import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<Void> import(
               @RequestHeader(AirportConstant.AIRPORT_HEADER) String auth,
               @RequestParam("file") MultipartFile file,
               @RequestParam("userId") String userId,
               @RequestParam(value = "icao") String icao,
      @RequestParam(value = "entity", required = false) String entity) throws GlobalException {
        LOGGER.info("::  entering into  import ::");

Tried with multipart boundary

----airMaster34
Content-Disposition: form-data; name=\"userId\"

check
----airMaster34
Content-Disposition: form-data; name=\"icao\"

KORD
----airMaster34
Content-Disposition: form-data; name=\"file\"; filename=\"small.ascii\"
Content-Type: application/octet-stream

 <file content in byte>
----airMaster34--

Powerautomate headers details
Content-Type: multipart/form-data; boundary=--airMaster34

Query Parameter details
userId: check icao: KORD

发布评论

评论列表(0)

  1. 暂无评论