Bug 56197 - HTTP Request Component fails to Send File with the Request
Summary: HTTP Request Component fails to Send File with the Request
Status: RESOLVED DUPLICATE of bug 60015
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.11
Hardware: All All
: P2 major (vote)
Target Milestone: JMETER_5.0
Assignee: JMeter issues mailing list
URL:
Keywords: FixedInTrunk
Depends on: 60015 62785
Blocks:
  Show dependency tree
 
Reported: 2014-02-27 21:31 UTC by toogoodtopassup
Modified: 2018-10-27 14:55 UTC (History)
2 users (show)



Attachments
file will not be sent if the UI is on the 'Body Data' tab. fix it. (918 bytes, text/plain)
2014-10-24 06:31 UTC, harry_no_spot
Details

Note You need to log in before you can comment on or make changes to this bug.
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 ***
Comment 3 The ASF infrastructure team 2022-09-24 20:37:56 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3330