How to Troubleshoot Failed JPEG/JPG Document Uploads in IXP Unstructured Documents? The images are saved in an MPO format.
Issue Description:
When uploading JPEG/JPG documents to IXP Unstructured Documents for annotation or training, certain JPEG/JPG files fail to upload and display the following error:
Error uploading document: Invalid document content
The issue may occur intermittently, where certain JPEG/JPG files upload successfully while other JPEG/JPG files fail, regardless of file size.
Symptoms:
- The browser Network tab shows the upload request failing with:
- HTTP Status: 400 Bad Request
- Response: {"status":"error","message":"Invalid document content."}
- The issue occurs intermittently, with no consistent correlation to file size. Certain JPEG/JPG files upload successfully, while others fail.
- Compressing the affected JPEG/JPG document allows the upload to complete successfully.
- The same files upload and process successfully in AI Center Data Labeling.
- The same files process successfully when tested with the Digitize Document activity.
- The issue is not limited to a specific file size range.
Root Cause:
Certain .jpeg/.jpg files fail to upload because they are not standard single-image JPEGs, but are instead saved in MPO (Multi-Picture Object) format — a JPEG extension used by phones and cameras with dual-camera or 3D/stereoscopic capture modes. MPO files are structurally valid JPEGs but contain an additional embedded image (such as a depth or stereo pair) stored in a JPEG APP2 "MPF" segment appended after the file's standard end-of-image marker.
Because MPO files retain the .jpg/.jpeg extension, they appear identical to normal JPEGs in Windows Explorer, standard image viewers, and even tools like Photoshop or ImageMagick. However, backend image-processing libraries that inspect file structure rather than relying on the extension — such as Python's Pillow library, which is commonly used in document/image ingestion pipelines — detect the embedded MPF segment and classify the file's format as "MPO" instead of "JPEG." Since MPO is not a supported format for standard JPEG ingestion, the file is rejected with an error, even though it opens normally everywhere else.
Identification Steps:
To confirm whether a file contains MPO-related metadata, use ExifTool. This tool can inspect image metadata and reveal information not visible through Windows File Explorer or standard image viewers.
Once ExifTool is installed, run the following command against a file that is failing to upload in IXP:
exiftool <filename>.jpg
If the file contains MPO-related information, ExifTool output may display fields such as:
- MPF
- Version
- Number Of Images
- MP Image Flags
The presence of these fields confirms the file is an MPO file saved with a .jpg/.jpeg extension.
Resolution:
Strip metadata from the affected images to create cleaned copies using ExifTool. Place all images failing to upload to IXP into a single folder, update the SourceFolder and OutputFolder paths in the script below, then run the following command:
$SourceFolder = "C:\Images"
$OutputFolder = "C:\Images_Clean"
New-Item -ItemType Directory -Force -Path $OutputFolder
Get-ChildItem $SourceFolder -Include *.jpg,*.jpeg -File | ForEach-Object {
exiftool -all= -o "$OutputFolder\%f.jpg" $_.FullName
}
Script behavior:
- Creates the output folder if not already present.
- Scans the source folder for all .jpg/.jpeg files.
- Runs ExifTool with the -all= flag to strip all metadata, including the embedded MPF segment responsible for the MPO classification.
- Saves cleaned copies to the output folder, retaining the original filenames.
Use the cleaned copies from the output folder for re-upload to IXP. Removal of the MPF segment and embedded secondary image leaves a single-frame standard JPEG, resolving the "Invalid document content" error.
Alternative Resolution: If the issue affects only one or two .jpg/.jpeg files, compress the affected images and re-upload them to IXP Unstructured Documents, as compression typically removes the MPO metadata and resolves the upload issue without requiring the ExifTool script.
If the issue persists after completing the above steps, raise a UiPath Support ticket and include the following:
- Sample .jpg/.jpeg files that fail to upload.
- A HAR trace captured while reproducing the issue.
For instructions on collecting a HAR trace, refer to the the KB article below.
