{"record":{"id":"b18b7299d6629915","repo":"flowable/flowable-engine","slug":"no-file-content-was-found-in-request-body-b18b72","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/task/TaskVariableBaseResource.java","lineNumber":127,"sourceCode":"\n        if (scope == RestVariableScope.GLOBAL) {\n            if (task.getExecutionId() != null && runtimeService.hasVariable(task.getExecutionId(), variableName)) {\n                variableFound = true;\n            }\n\n        } else if (scope == RestVariableScope.LOCAL) {\n            if (taskService.hasVariableLocal(task.getId(), variableName)) {\n                variableFound = true;\n            }\n        }\n        return variableFound;\n    }\n\n    protected RestVariable setBinaryVariable(MultipartHttpServletRequest request, Task task, boolean isNew) {\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":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskVariableBaseResource.java#L109-L145","documentation":"FlowableIllegalArgumentException thrown by setBinaryVariable when the multipart request contains zero files. A binary task variable is created from the first file in the multipart file map, so at least one file part is mandatory.","triggerScenarios":"POST or PUT /runtime/tasks/{taskId}/variables sent as multipart/form-data with no file part (only form fields, or an empty body).","commonSituations":"HTTP clients defaulting to urlencoded instead of multipart; a file path that resolved to nothing so no file part was attached; proxy stripping file parts.","solutions":["Attach the file as a multipart file part in the request","Ensure the HTTP client content type is multipart/form-data, not application/json or urlencoded","Check the file exists locally before sending so the client actually attaches it"],"exampleFix":"// before\ncurl -X POST url/variables -F \"scope=local\"\n// after\ncurl -X POST url/variables -F \"scope=local\" -F \"file=@data.bin\"","handlingStrategy":"validation","validationCode":"if (file == null || !file.exists()) throw new IllegalStateException(\"Nothing to upload: file missing\");","typeGuard":null,"tryCatchPattern":"try { uploadBinaryVariable(taskId, file) } catch (FlowableIllegalArgumentException e) { log.error(\"Multipart body must contain a file part\"); }","preventionTips":["Always configure the HTTP client for multipart/form-data on variable upload endpoints","Check file existence before building the request","Send exactly one file part per request"],"tags":["rest-api","multipart","validation"],"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"}