Bug 56197

Summary: HTTP Request Component fails to Send File with the Request
Product: JMeter Reporter: toogoodtopassup
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED DUPLICATE    
Severity: major CC: p.mouawad, toogoodtopassup
Priority: P2 Keywords: FixedInTrunk
Version: 2.11   
Target Milestone: JMETER_5.0   
Hardware: All   
OS: All   
Bug Depends on: 60015, 62785    
Bug Blocks:    
Attachments: file will not be sent if the UI is on the 'Body Data' tab. fix it.

Description toogoodtopassup 2014-02-27 21:31:50 UTC
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...)
Comment 1 harry_no_spot 2014-10-24 06:31:26 UTC
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.
Comment 2 Philippe Mouawad 2018-10-27 14:55:18 UTC
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 ***