flowable/flowable-engine · error · FlowableIllegalArgumentException

Multipart request with file content is required

Error message

Multipart request with file content is required

What it means

The request was recognized as multipart but contained zero file parts. The handler requires at least one file in the multipart map because the first file becomes the DMN deployment resource, and throws FlowableIllegalArgumentException otherwise.

Source

Thrown at modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DmnDeploymentCollectionResource.java:169

    @ApiImplicitParams({
        @ApiImplicitParam(name="file", paramType = "form", dataType = "java.io.File")
    })
    @PostMapping(value = "/dmn-repository/deployments", produces = "application/json", consumes = "multipart/form-data")
    @ResponseStatus(HttpStatus.CREATED)
    public DmnDeploymentResponse uploadDeployment(@ApiParam(name = "tenantId") @RequestParam(value = "tenantId", required = false) String tenantId, HttpServletRequest request) {

        if (!(request instanceof MultipartHttpServletRequest)) {
            throw new FlowableIllegalArgumentException("Multipart request is required");
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.executeNewDeploymentForTenantId(tenantId);
        }

        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;

        if (multipartRequest.getFileMap().size() == 0) {
            throw new FlowableIllegalArgumentException("Multipart request with file content is required");
        }

        MultipartFile file = multipartRequest.getFileMap().values().iterator().next();

        try {
            DmnDeploymentBuilder deploymentBuilder = dmnRepositoryService.createDeployment();
            String fileName = file.getOriginalFilename();
            if (StringUtils.isEmpty(fileName) || !DmnResourceUtil.isDmnResource(fileName)) {
                fileName = file.getName();
            }

            if (DmnResourceUtil.isDmnResource(fileName)) {
                try (final InputStream fileInputStream = file.getInputStream()) {
                    deploymentBuilder.addInputStream(fileName, fileInputStream);
                }
                
            } else {
                throw new FlowableIllegalArgumentException("File must be of type .dmn");

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Attach the DMN file as a proper file part: curl -F 'file=@decision.dmn'.
  2. In Java clients use a MultipartBody/FilePart (e.g. RestTemplate with MultiValueMap containing a ByteArrayResource/FileSystemResource).
  3. Validate on the client that the file input is non-empty before submitting the form.
  4. Check the multipart field is registered as type 'file', not a text field.

Example fix

// before
const form = new FormData(); form.append('file', document.querySelector('input').value);
// after
const input = document.querySelector('input[type=file]');
if (!input.files.length) throw new Error('select a .dmn file');
const form = new FormData(); form.append('file', input.files[0]);
Defensive patterns

Strategy: validation

Validate before calling

const input = document.querySelector('input[type=file]');
if (!input || input.files.length === 0) throw new Error('attach a .dmn file before submitting');

Try / catch

try { return await deploy(multipartRequest); }
catch (e) { if (e.status === 400 && /file content is required/.test(e.message)) { alert('Select a file to deploy'); } throw e; }

Prevention

When it happens

Trigger: POST /dmn-repository/deployments as multipart/form-data containing only text fields (e.g. tenantId) and no file part, or an empty file part map because the client sent the file as a plain field instead of a file part.

Common situations: curl -F 'file=decision.dmn' (string, not @file), forms where the file input was left empty, or clients using x-www-form-urlencoded field names in a multipart body.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/5438068a5161ce8f. Report an issue: GitHub.