There are several options on how you can proceed:
You can use HTTP Raw Request Sampler (available through JMeter Plugins site) which gives you full control on what, how and where you send.
Have you tried enabling
Use multipart/form-data for POST
for HTTP Request Sampler? This is how files should be uploaded as per RFC-1867.If your use case is specific and none of the above is applicable, you can always use JMeter Scripting extensions. For example if you add a Beanshell Pre Processor to your HTTP Request which performs file upload with something like:
FileInputStream in = new FileInputStream("/home/glinius/401.png"); ByteArrayOutputStream bos = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; for (int i; (i = in.read(buffer)) != -1; ) { bos.write(buffer, 0, i); } in.close(); byte[] imageData = bos.toByteArray(); bos.close(); vars.put("imageData", new String(imageData));
You'll be able to add ${imageData}
parameter in your POST request.