Sorry for the ongoing spam about JMeter stuff but I am writing a LOT of coding at the moment and I thought I’d share some of the knarly stuff I come accross so others might benefit.
So I had the issue that I need to cobble together MIME HTTP/SOAP calls that contain attachments. JMeter has the ability to add files statically to an HTTP Request (Body Data) but if you need more control you need to roll your own. Best way to do this would be to load the file into a variable and just attach like this:
... --MIME_boundary Content-Type: application/pdf Content-Transfer-Encoding: binary Content-ID: <MyFile.pdf> Content-Disposition: attachment; name="MyFile.pdf" ${AttachmentFile} --MIME_boundary-- ...
But how do you get it into the variable?