Hi Rajan,
Why it fails on Import
The upload is not actually finished when you see the file selected. With the File Manager inside a data view, Mendix only sends the file to the server when the form is submitted, and that happens right before a microflow is called or the page is saved. So clicking Import is the moment the file really gets uploaded.
That's why your stack trace goes through FileUploadHelper. Your Java action never even starts; the request fails while uploading.
What the error means
The request is bigger than the 10 MB form limit of the runtime (10485760 bytes), so your CSV plus the form overhead is over 10 MB. The Max File Size setting on the File Manager doesn't change this; even if you set it higher, this limit still applies.
How to fix it
1. Keep the CSV under 10 MB, for example by splitting large files, or zip it and unzip it in your Java action.
2. On Mendix Cloud this limit is a platform setting, so ask Mendix Support whether they can raise it for your environment.
3. To confirm, add a separate Save/Upload button that only commits the FileDocument. If that also fails with the same error, it's the upload size and not your import logic.
Side note
For big CSV files, read the contents as a stream in your Java action instead of loading the whole file into one string or one big JSON, otherwise you'll run into memory problems next.
Hope this helps. If it works for you, please mark the answer as accepted so others with the same issue can find it.
Hi Rajan,
Based on the exception and the workflow you described, I would investigate the HTTP request handled by Mendix's file-upload mechanism before changing the CSV parsing Java action.
The exception:
java.lang.IllegalStateException: Form is larger than max length 10485760
indicates that the request's form content exceeds the configured 10 MiB parsing limit. The FileUploadHelper entries in the stack trace are particularly important because they point to file-upload handling.
Step 1: Identify the exact request that fails
F12 and select the Network tab.Check whether the failed request is a file-upload request or the request that invokes your import logic.
Step 2: Check whether the file is being uploaded twice
If the upload request fails when you click Import, verify whether the page or a custom widget is submitting the CSV again.
If the file has already been uploaded and stored as a System.FileDocument, the import process should use that existing object. It should not send the entire CSV through the browser again.
If the Network tab confirms a duplicate upload, correct the button or widget flow so that Import operates on the existing FileDocument object.
Step 3: Pass the existing FileDocument to the import microflow
A suitable flow is:
Upload CSV → Store FileDocument → Click Import → Pass FileDocument to microflow → Read stored content → Parse CSV → Process records
For example:
FileDocument object.This avoids unnecessarily transmitting the entire file again during import.
Step 4: If the request is not a duplicate upload
If the failed request is the original upload, check the actual file size and the complete request payload. Multipart form data includes boundaries and additional fields, so the request size may be larger than the file alone.
If the CSV is smaller than 10 MiB but the request still exceeds the limit, inspect whether the request contains duplicated file content, Base64 data, or other large fields.
If the request is genuinely larger than the configured limit, review the supported request-size configuration for your specific Mendix runtime version and deployment type. Do not assume that changing a generic Jetty setting will override the limit used by the Mendix runtime.
Step 5: Test the corrected flow
Test with:
Confirm that the file is uploaded once, the Import action receives the existing FileDocument, and the CSV parsing logic executes successfully.
I would not change the CSV-to-JSON conversion code first. The stack trace indicates that the request is rejected during form parsing, but it does not yet prove whether the cause is a duplicate upload or an oversized original request.
Could you share the failing Network request's URL and the CSV file size? Those two details will help distinguish the two cases and identify the appropriate fix.
Reference: Mendix Community – Uploading file failed: 400 Unable to parse form content
Hope this helps!