You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Roderick Parks <ro...@triometric.net> on 2012/11/21 17:11:34 UTC

How to send a null filename?

I've got a situation where I appear to be falling between two stools.

I have a multi-stage process in a web application which consists of uploading a file and then performing several operations on it.  The upload stage is fine - the problem arises with the subsequent stages.

The application, when running via IE. produces the following in its form POST for the second stage:

-----------------------------7dcca18d046a
Content-Disposition: form-data; name="UploadFileControl"; filename=""
Content-Type: application/octet-stream


-----------------------------7dcca18d046a

As you can see, this has a null filename.

I can recreate this in my JMeter test script, and it produces:

--7KuasTCyGRcIVS-GlnO7ypZpVo7IJO5IsBYge2
Content-Disposition: form-data; name="UploadFileControl"; filename=""
Content-Type: application/vnd.ms-excel
Content-Transfer-Encoding: binary

<actual file content, not shown here>
--7KuasTCyGRcIVS-GlnO7ypZpVo7IJO5IsBYge2--

This seems superficially OK, but the problem is that JMeter fails with a file not found exception and thus the sample does not run.

If I remove the null filename, the sample runs, but the web application fails to perform the required operation.

Do you know how I can 'fake' the null file in JMeter, so that it does not throw an exception yet enables the web application to receive the required null parameter?

Thanks, Roderick




Re: How to send a null filename?

Posted by Shmuel Krakower <sh...@gmail.com>.
Maybe a preprocessor to set the filename header to emtpy string?
On Nov 21, 2012 6:22 PM, "sebb" <se...@gmail.com> wrote:

> On 21 November 2012 16:11, Roderick Parks <ro...@triometric.net>
> wrote:
> > I've got a situation where I appear to be falling between two stools.
> >
> > I have a multi-stage process in a web application which consists of
> uploading a file and then performing several operations on it.  The upload
> stage is fine - the problem arises with the subsequent stages.
> >
> > The application, when running via IE. produces the following in its form
> POST for the second stage:
> >
> > -----------------------------7dcca18d046a
> > Content-Disposition: form-data; name="UploadFileControl"; filename=""
> > Content-Type: application/octet-stream
> >
> >
> > -----------------------------7dcca18d046a
> >
> > As you can see, this has a null filename.
> >
> > I can recreate this in my JMeter test script, and it produces:
> >
> > --7KuasTCyGRcIVS-GlnO7ypZpVo7IJO5IsBYge2
> > Content-Disposition: form-data; name="UploadFileControl"; filename=""
> > Content-Type: application/vnd.ms-excel
> > Content-Transfer-Encoding: binary
> >
> > <actual file content, not shown here>
> > --7KuasTCyGRcIVS-GlnO7ypZpVo7IJO5IsBYge2--
> >
> > This seems superficially OK, but the problem is that JMeter fails with a
> file not found exception and thus the sample does not run.
> >
> > If I remove the null filename, the sample runs, but the web application
> fails to perform the required operation.
> >
> > Do you know how I can 'fake' the null file in JMeter, so that it does
> not throw an exception yet enables the web application to receive the
> required null parameter?
>
> As a workround you can provide a file that contains the entire POST
> content including headers.
>
> > Thanks, Roderick
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: How to send a null filename?

Posted by sebb <se...@gmail.com>.
On 21 November 2012 16:11, Roderick Parks <ro...@triometric.net> wrote:
> I've got a situation where I appear to be falling between two stools.
>
> I have a multi-stage process in a web application which consists of uploading a file and then performing several operations on it.  The upload stage is fine - the problem arises with the subsequent stages.
>
> The application, when running via IE. produces the following in its form POST for the second stage:
>
> -----------------------------7dcca18d046a
> Content-Disposition: form-data; name="UploadFileControl"; filename=""
> Content-Type: application/octet-stream
>
>
> -----------------------------7dcca18d046a
>
> As you can see, this has a null filename.
>
> I can recreate this in my JMeter test script, and it produces:
>
> --7KuasTCyGRcIVS-GlnO7ypZpVo7IJO5IsBYge2
> Content-Disposition: form-data; name="UploadFileControl"; filename=""
> Content-Type: application/vnd.ms-excel
> Content-Transfer-Encoding: binary
>
> <actual file content, not shown here>
> --7KuasTCyGRcIVS-GlnO7ypZpVo7IJO5IsBYge2--
>
> This seems superficially OK, but the problem is that JMeter fails with a file not found exception and thus the sample does not run.
>
> If I remove the null filename, the sample runs, but the web application fails to perform the required operation.
>
> Do you know how I can 'fake' the null file in JMeter, so that it does not throw an exception yet enables the web application to receive the required null parameter?

As a workround you can provide a file that contains the entire POST
content including headers.

> Thanks, Roderick
>
>
>

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