Files are disappearing in Multipart Multiple Files Upload

Good morning everyone, I am coming to ask for your help.

So, here is the issue : I set up a webserver with Unreal Engine 5. I want to be able to sent a POST Request to that server and that POST Request would contain a certain amount of files of different formats of 3D models. I am using Postman to test the request.

Here is the annoying part: if I send 1 file, it works fine, if I attempt to send multiple .obj files, it works fine as well, but I attempt to send multiple files, the request body will stop after the first non-.obj file. Here is how I check the request’s body content:

const TArray<uint8>& Body = Request.Body; // Request being a FHttpServerRequest&
FString Readable_Body = FString(UTF8_TO_TCHAR(reinterpret_cast<const char*>(&Body[0])), Request.Body.Num());
UE_LOG(LogTemp, Log, TEXT("Body: %s"), *Readable_Body);

And I get the following Log:

[[2025.01.22-14.56.18:379][175]]LogTemp: Body: ----------------------------527711195964466230610491
Content-Disposition: form-data; name="OBJ_1"; filename="cubeObj.obj"
Content-Type: model/obj
[Full .obj content]
----------------------------527711195964466230610491
Content-Disposition: form-data; name="OBJ_2"; filename="cubeObj2.obj"
Content-Type: model/obj
[Full .obj content]
----------------------------527711195964466230610491
Content-Disposition: form-data; name="FBX_1"; filename="cubeFbx.fbx"
Content-Type: application/octet-stream
Kaydara FBX Binary  

Which would be really nice if there weren’t three other .glb as well in that request. I am at an absolute loss at to what causes my files to disappear and I am thus humbly requesting help from the all-powerful web.

These things I can think of now can cause the problem you’re describing:

  • Unreal’s default UTF8_TO_TCHAR conversion may truncate or misinterpret the binary data of .fbx or .glb files, especially if they contain non-UTF-8 characters. Check the length of Request.Body and ensure it’s fully processed.
    Modify the reading logic to treat the body as binary data rather than attempting a UTF-8 conversion.
FString Readable_Body = FString::FromHexBlob(Body.GetData(), Body.Num());
  • Postman might not be setting the correct Content-Type header for .fbx or .glb files, causing Unreal’s parser to stop. Explicitly specify Content-Type for each file in Postman:
    .obj: model/obj (as you’re already using)
    .fbx: application/octet-stream or application/vnd.fbx
    .glb: model/gltf-binary

  • Maybe FHttpServerRequest has a limit on the multipart content and it’s not the file type. To be sure it’s the file extension, try using Postman to set the problematic file extension the first file and check if the rest isn’t received or sent.

I hope it helps.

Yes, your first point was right, thanks you.