How to upload file using file path instead of RawFileBody?

Hi,

I’m using gatling-charts-highcharts-2.0.0-SNAPSHOT archetype for IntelliJ. My page have some textboxes and upload file control, when running Recorder to record upload file, i have:
.exec(http(“request_15”)
.post("""/pages/upload.aspx""")
.headers(headers_15)
.body(RawFileBody(“upload_request_15.txt”)))

“upload_request_15.txt” contains:

-----------------------------207612174825532
Content-Disposition: form-data; name=“configuration”

{“ContainerUid”:“dd06748f-0980-47cd-b8fe-85c5c2a1feeb”,“DocumentTypeAccessLevel”:“Program”,“UserEnteredFileName”:“Test Koala 5”,“DocumentTypeUid”:“8ffd0388-0ea9-44f1-a42f-c610e9b45553”,“ProgramUid”:“cd5def0e-2b24-4ebe-bf5c-b8cf811340ff”,“SafetyEventDate”:“04/30/2014”,“McnNumber”:“44”,“Dose”:“555”,“TrialOfOrigin”:“66”}
-----------------------------207612174825532
Content-Disposition: form-data; name=“files[]”; filename=“Koala.jpg”
Content-Type: image/jpeg

…format file content here.

-----------------------------207612174825532–

How can i change scenario to achieve above by using file path instead of “upload_request_15.txt” format above (note: there is JSON value in the file)?

Thanks.

You have to use BodyParts instead: https://github.com/excilys/gatling/blob/master/src/sphinx/http/http_request.rst#request-body