Gatling file upload

Hi All ,
Hi have created gatling framework to verify performance .
I am stuck at one point .
I want to upload xml file for post request .
I am not able to upload file.
I have tried following multiple approaches .
2.formUpload(“Burp”, “./src/test/resources/Data/Burp.xml”)
3.body(RawFileBody(filePath = “./src/test/resources/Data/” + “Burp.xml”)).asMultipartForm
4.formUpload(“Burp.xml”, “./src/test/resources/Data/”)
6.bodyPart(StringBodyPart(“Burp.xml”, “./src/test/resources/Data/Burp.xml”).contentType(“multipart/form-data”).fileName(“bugcrowd.xml”))
9.bodyPart(RawFileBodyPart(“./src/test/resources/Data/Burp.xml”, “./src/test/resources/Data/Burp.xml”).fileName(“./src/test/resources/Data/Burp.xml”)

Still I am getting 500 error
I want to achieve following that I have achieved in post

Hi @Tejas,

What an impressive list of tests :clap:

Did you try to express that the body part is of XML content type?

Something like:

    ChainBuilder postFile = exec(
            http("Send file").post("/api/file-upload")


  • In a “multipart” form, each part should have its own content-type.
  • Avoid file path relative to your project architecture (when compiled as jar, your simulation won’t find the path, as src/test/resources is directly at the root of the built jar)
  • Did you succeed to upload via curl? (I’m not sure what postman does under the hood)
  • “500” is “Internal Server Error” => not very useful. As you are pretty sure the request is faulty, it should response with “400 Bad Request”

Hope it helps!

Hi @sbrevet
Thanks for reply .

I also tried -

Still i am getting 500 error

And can we see full request log from postman? (list of headers, format of body, etc.)


Which version of Gatling are you using?

yes it on succeed on post man.
Format of body is added in screenshot of first comment
In body I have uploaded file under form-data

@slandelle Hello ,
I am using following version

This version is very outdated. There’s a very good chance that your issue has been fixed since then.
Please upgrade to:


Make sure to check the official demo project for maven + Scala.

If you still experience an issue after upgrading, please provide a reproducer so we can investigate, see How to Ask a Question.

Hey @sbrevet @slandelle
Issue got resolved .
Just added ?isBase64=false at end of api .

Thanx for the help