You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ch...@labware.com on 2006/05/04 14:45:15 UTC

How to send a file attachment

Hi All,

Using JMeter, Im trying to send a post request and sending a file 
attachment with that request.

Could you please give me some idea, how to send a file attachment in a web 
application in JMeter?

Chinmoy


Re: How to send a file attachment

Posted by sebb <se...@gmail.com>.
In 04/05/06, Chakraborty@labware.com <Ch...@labware.com> wrote:
> Hi Sebbaz,
>
> Actually my url for post request is something like,
>
> /abc/index.htm?tar=_top&curscrid=index&id=ec940&val=null

OK, so set the Parameters:

tar            _top
curscrid   index
etc

> Along with the request following are the request data:
>
>

> Now if I put the filename and parameter name in HTTP Sampler, itz not
> forming the right request data. Actually here the parameter name is "name"
> and the value is ${dynamic variable}; filename="abc.txt".
>
> So in filename field I canot enter  ${dynamic variable};
> filename="abc.txt".

Enter the actual file name in the filename field.

Enter the value of the "name" attribute in the FileName Parameter field
[this is poorly named; I'll update the docs]

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: How to send a file attachment

Posted by Ch...@labware.com.
Hi Sebbaz,

Actually my url for post request is something like,

/abc/index.htm?tar=_top&curscrid=index&id=ec940&val=null

Along with the request following are the request data:


Accept-Language: en-us,fr;q=0.5
Content-Type: multipart/form-data; 
boundary=---------------------------7d637a81e07fe
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET 
CLR 1.1.4322)
Host: localhost:2222
Content-Length: 3715
Connection: Keep-Alive
Cache-Control: no-cache

Content-Disposition: form-data; name="_C9FCDCD4C8D64740B69EB9BCCE0F1DF3"; 
filename="C:\a.txt"
Content-Type: text/plain

FILE
NAMES
PRINTERSETUP
PRINT
PRINTINTERPRETATION
...
-----------------------------7d637a81e07fe
Content-Disposition: form-data; 
name="ec_fid"_E80767BCCE054097B1DD49ADC47EE676
-----------------------------7d637a81e07fe
Content-Disposition: form-data; 
name="ec_focus_context"_C9FCDCD4C8D64740B69EB9BCCE0F1DF3
-----------------------------7d637a81e07fe

Now if I put the filename and parameter name in HTTP Sampler, itz not 
forming the right request data. Actually here the parameter name is "name" 
and the value is ${dynamic variable}; filename="abc.txt".

So in filename field I canot enter  ${dynamic variable}; 
filename="abc.txt".

In the original request, there are three name parameter for three 
different dynamic values. If I put filename in HTTP Sampler, it is missing 
the sequence of request data hence making wrong request. Hope I made you 
understand what my problem is.

Thanx for your reply.

Chinmoy











sebb <se...@gmail.com> 
05/04/2006 06:17 PM
Please respond to
"JMeter Users List" <jm...@jakarta.apache.org>


To
"JMeter Users List" <jm...@jakarta.apache.org>
cc

Subject
Re: How to send a file attachment






Have a look at the HTTP Sampler - does it not have a field where you
can attach a file?

On 04/05/06, Chakraborty@labware.com <Ch...@labware.com> wrote:
> Hi All,
>
> Using JMeter, Im trying to send a post request and sending a file
> attachment with that request.
>
> Could you please give me some idea, how to send a file attachment in a 
web
> application in JMeter?
>
> Chinmoy
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org



Re: How to send a file attachment

Posted by sebb <se...@gmail.com>.
Have a look at the HTTP Sampler - does it not have a field where you
can attach a file?

On 04/05/06, Chakraborty@labware.com <Ch...@labware.com> wrote:
> Hi All,
>
> Using JMeter, Im trying to send a post request and sending a file
> attachment with that request.
>
> Could you please give me some idea, how to send a file attachment in a web
> application in JMeter?
>
> Chinmoy
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org