{"record":{"id":"7cfaa98742acfabf","repo":"flowable/flowable-engine","slug":"multipart-request-with-file-content-is-required-7cfaa9","errorCode":null,"errorMessage":"Multipart request with file content is required","messagePattern":"Multipart request with file content is required","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/DeploymentCollectionResource.java","lineNumber":182,"sourceCode":"            @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 {\n            CmmnDeploymentBuilder deploymentBuilder = repositoryService.createDeployment();\n            String fileName = file.getOriginalFilename();\n            if (StringUtils.isEmpty(fileName) || !(fileName.endsWith(\".cmmn.xml\") || fileName\n                    .endsWith(\".cmmn\") || fileName.toLowerCase().endsWith(\".bar\") || fileName\n                    .toLowerCase().endsWith(\".zip\"))) {\n\n                fileName = file.getName();\n            }\n\n            if (fileName.endsWith(\".cmmn.xml\") || fileName.endsWith(\".cmmn\")) {\n                try (final InputStream fileInputStream = file.getInputStream()) {\n                    deploymentBuilder.addInputStream(fileName, fileInputStream);\n                }","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/DeploymentCollectionResource.java#L164-L200","documentation":"After confirming the request is multipart, the endpoint requires at least one file part because the deployment to import is the uploaded file. It reads `multipartRequest.getFileMap()` and throws when the map is empty, meaning the request had form fields but no file content.","triggerScenarios":"POST a multipart/form-data request to the deployments endpoint where all parts are regular form fields (no file parts), e.g. sending only deploymentKey/deploymentName fields, or the client sent data as form fields instead of a file part.","commonSituations":"Clients appending deploymentName as a file-less form field while forgetting the file part; scripting tools that turn the payload into text fields; multipart parser configured to treat files as plain parameters.","solutions":["Include the deployment artifact as a file part, e.g. `curl -F 'file=@case.cmmn.xml' .../repository/deployments`.","Verify the part is sent as a file (Content-Disposition with filename) so it appears in getFileMap().","Check the client library: use the file-upload API (e.g. requests' files=, axios FormData) rather than form body fields."],"exampleFix":"// before (no file part)\nform.append('deploymentName', 'myCase');\naxios.post('/repository/deployments', form);\n\n// after (file part present)\nform.append('file', new File([bytes], 'case.cmmn.xml'));\naxios.post('/repository/deployments', form);","handlingStrategy":"validation","validationCode":"if (!form.has('file') || !(form.get('file') instanceof File)) {\n  throw new Error('Multipart request must include a file part');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Append the artifact as a file part, not a text field.","Log the outgoing request parts in tests to confirm the file part exists."],"tags":["rest-api","multipart","file-upload","flowable"],"backgroundTag":"missing-required-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}