I am trying to send a file as the body of a POST request, so the Parameters and Body Data are both empty, as is the Parameter Name and Mime Type of the file. There are several related bugs here that cause this to fail. 1) The File Path does not properly expand the '~' character to be relative to the .jmx file. Also, a relative path does not work either. For example, if you have a file named 'test.txt' next to your project.jmx file, neither of these File paths will reach it: ~/test.txt text.txt ~text.txt An absolute path works, but that is just about useless in most environments. 2) The file will not be sent if the UI is on the 'Body Data' tab, even if this tab has no content. Simply switching to the Parameters tab causes the file to be included. 3) If the file is included in the body of the POST, user parameters, eg ${myVarName}, are not replaced before the content is sent in the body. This is unexpected b/c these variables are replaced if you put them in the Body Data tab. As a final note, the handling of '~' as being relative to the .jmx file is inconsistent across components. The docs say this should work, but it doesn't work for this component or for the CSV Data Set Config component (I know, its another bug...)
Created attachment 32142 [details] file will not be sent if the UI is on the 'Body Data' tab. fix it. patch for: 2) The file will not be sent if the UI is on the 'Body Data' tab, even if this tab has no content. Simply switching to the Parameters tab causes the file to be included.
Fixed within release 5.0. 1) fixed within Bug 62785 2) fixed within Bug 60015 3) this is a known limitation that will not be fixed as it would impact performances *** This bug has been marked as a duplicate of bug 60015 ***
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3330