{"record":{"id":"d77dd7543f4cdb9f","repo":"flowable/flowable-engine","slug":"no-file-content-was-found-in-request-body-d77dd7","errorCode":null,"errorMessage":"No file content was found in request body.","messagePattern":"No file content was found in request body\\.","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseExecutionVariableResource.java","lineNumber":106,"sourceCode":"                    result = buffer.toByteArray();\n                    response.setContentType(\"application/x-java-serialized-object\");\n                }\n\n            } else {\n                throw new FlowableObjectNotFoundException(\"The variable does not have a binary data stream.\", null);\n            }\n            return result;\n\n        } catch (IOException ioe) {\n            throw new FlowableException(\"Error getting variable \" + variableName, ioe);\n        }\n    }\n\n    protected RestVariable setBinaryVariable(MultipartHttpServletRequest request, Execution execution, boolean isNew, boolean async) {\n\n        // Validate input and set defaults\n        if (request.getFileMap().size() == 0) {\n            throw new FlowableIllegalArgumentException(\"No file content was found in request body.\");\n        }\n\n        // Get first file in the map, ignore possible other files\n        MultipartFile file = request.getFile(request.getFileMap().keySet().iterator().next());\n\n        if (file == null) {\n            throw new FlowableIllegalArgumentException(\"No file content was found in request body.\");\n        }\n\n        String variableScope = null;\n        String variableName = null;\n        String variableType = null;\n\n        Map<String, String[]> paramMap = request.getParameterMap();\n        for (String parameterName : paramMap.keySet()) {\n\n            if (paramMap.get(parameterName).length > 0) {\n","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseExecutionVariableResource.java#L88-L124","documentation":"FlowableIllegalArgumentException thrown by setBinaryVariable when the multipart request contains no file entries at all (request.getFileMap() is empty). The endpoint expects at least one file part carrying the variable content.","triggerScenarios":"POST/PUT to an execution or process-instance variable resource with multipart content-type but zero file parts (only form fields, or empty body).","commonSituations":"Client sends JSON or urlencoded body to a multipart endpoint; HTTP client library not configured for multipart upload; file part name mismatch causing the file map to be empty.","solutions":["Attach at least one file part in the multipart request (any part name; first file is used)","Ensure Content-Type is multipart/form-data and the client serializes files as file parts","Catch FlowableIllegalArgumentException and return 400 with guidance on required file part"],"exampleFix":"// before\nform.field(\"data\", fileBytes); // form field, not a file part\n// after\nform.add(\"data\", new ByteArrayBody(fileBytes, ContentType.DEFAULT_BINARY, \"data.bin\"));\nHttpPost post = new HttpPost(url);\npost.setEntity(MultipartEntityBuilder.create().addPart(\"data\", form).build());","handlingStrategy":"validation","validationCode":"if (file == null || file.length() == 0) {\n    throw new IllegalArgumentException(\"multipart request must include a file part\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    client.uploadBinaryVariable(executionId, name, file);\n} catch (HttpClientErrorException.BadRequest e) {\n    // body: No file content was found in request body.\n}","preventionTips":["Always add at least one file part (not a plain form field) to the multipart request","Verify Content-Type is multipart/form-data","Test uploads with curl -F before integrating"],"tags":["rest-api","multipart","validation","upload"],"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-14T05:17:10.506Z"}