{"record":{"id":"76d5292aaf70463c","repo":"flowable/flowable-engine","slug":"multipart-request-is-required-76d529","errorCode":null,"errorMessage":"Multipart request is required","messagePattern":"Multipart request is required","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/DeploymentCollectionResource.java","lineNumber":168,"sourceCode":"                    + \"An additional parameter (form-field) can be passed in the request body with name tenantId. The value of this field will be used as the id of the tenant this deployment is done in.\",\n            code = 201)\n    @ApiResponses(value = {\n            @ApiResponse(code = 201, message = \"Indicates the deployment was created.\"),\n            @ApiResponse(code = 400, message = \"Indicates there was no content present in the request body or the content mime-type is not supported for deployment. The status-description contains additional information.\")\n    })\n\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"file\", dataType = \"file\", paramType = \"form\", required = true)\n    })\n    @PostMapping(value = \"/event-registry-repository/deployments\", produces = \"application/json\", consumes = \"multipart/form-data\")\n    @ResponseStatus(HttpStatus.CREATED)\n    public EventDeploymentResponse uploadDeployment(@ApiParam(name = \"category\") @RequestParam(value = \"category\", required = false) String category,\n            @ApiParam(name = \"deploymentName\") @RequestParam(value = \"deploymentName\", required = false) String deploymentName,\n            @ApiParam(name = \"tenantId\") @RequestParam(value = \"tenantId\", required = false) String tenantId,\n            HttpServletRequest request) {\n\n        if (!(request instanceof MultipartHttpServletRequest)) {\n            throw new FlowableIllegalArgumentException(\"Multipart request is required\");\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.executeNewDeploymentForTenantId(tenantId);\n        }\n\n        String queryString = request.getQueryString();\n        Map<String, String> decodedQueryStrings = splitQueryString(queryString);\n\n        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;\n\n        if (multipartRequest.getFileMap().size() == 0) {\n            throw new FlowableIllegalArgumentException(\"Multipart request with file content is required\");\n        }\n\n        MultipartFile file = multipartRequest.getFileMap().values().iterator().next();\n\n        try {","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/DeploymentCollectionResource.java#L150-L186","documentation":"FlowableIllegalArgumentException thrown by DeploymentCollectionResource.uploadDeployment when the incoming HttpServletRequest is not a MultipartHttpServletRequest. Deployments are uploaded as file parts, so a plain (non-multipart) POST cannot be processed.","triggerScenarios":"POSTing to the deployments collection endpoint with Content-Type application/json, application/x-www-form-urlencoded, or no body instead of multipart/form-data with a file part.","commonSituations":"Forgetting to set multipart/form-data in curl/Postman, a reverse proxy or gateway stripping/altering the Content-Type, or the multipart resolver not being configured so Spring never converts the request.","solutions":["Send the request as multipart/form-data with a file part (curl -F \"file=@my-events.json\").","Ensure the MultipartResolver is configured in the Spring context so requests are adapted to MultipartHttpServletRequest.","Verify no proxy rewrites or drops the Content-Type header before it reaches the REST app."],"exampleFix":"// before\ncurl -X POST -H \"Content-Type: application/json\" -d '{}' http://host/event-registry-repository/deployments\n// after\ncurl -X POST -F \"file=@my-events.json\" -F \"deploymentName=myDeployment\" http://host/event-registry-repository/deployments","handlingStrategy":"validation","validationCode":"if (!(request instanceof MultipartHttpServletRequest)) throw new IllegalArgumentException(\"use multipart/form-data with a file part\");","typeGuard":"boolean isMultipart = request instanceof MultipartHttpServletRequest;","tryCatchPattern":"try { upload(files); } catch (FlowableIllegalArgumentException e) { return ResponseEntity.badRequest().body(\"send multipart/form-data\"); }","preventionTips":["Use curl -F / Postman form-data for deployment uploads","Ensure the Spring MultipartResolver is configured","Check proxies preserve the multipart Content-Type"],"tags":["rest-api","multipart","upload"],"backgroundTag":"invalid-argument-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}