You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Karuna Lingham <ka...@gmail.com> on 2019/11/04 11:46:56 UTC

FILE Upload: TypeError: Cannot read property 'size' of undefined

I am trying to send an image/video file to my API endpoint by attaching the
file under 'Files Upload' section of the HTTP Request and always get this
error: "TypeError: Cannot read property 'size' of undefined" For some
reason, the file does not get recognised on jmeter, tried on Postman and it
works fine. I have tried various things, but did not work. Can someone help
please? Thanks!! NOTE: this is a mobile application, so I tried the
HTTPRecorder already, but no luck there too. MIME Type: video/mp4
Content-Type: multipart/form-data

Re: FILE Upload: TypeError: Cannot read property 'size' of undefined

Posted by Karuna Lingham <ka...@gmail.com>.
Thanks! I'll try recording the Postman request.

1. I tried copying the file to JMeter's bin folder, no luck.
2. Already ticked the box - "Use multipart/form-data"
3. I'm using the same parameter name as in the Postman request.

Here is a screenshot of the request data and configuration in JMeter, if it
helps.

Thank you again, for your response..

On Tue, Nov 5, 2019 at 7:40 PM glinius@live.com <gl...@live.com> wrote:

> It is impossible to come up with the comprehensive response without seeing
> your request configuration, a short checklist:1. Make sure to copy the file
> to "bin" folder of your JMeter installation or to provide the full path to
> the file2. Tick "Use multipart/form-data" box in the  HTTP Request
> <
> https://jmeter.apache.org/usermanual/component_reference.html#HTTP_Request>
>
> sampler 3. Make sure to use correct "Parameter Name" under the "Files
> Upload" tab, it should be exactly the same as *name* parameter of the  file
> input <https://www.w3schools.com/tags/att_input_type_file.asp>  In general
> given you can successfully execute the request using Postman you could
> record the request using JMeter, just  configure Postman to use JMeter as
> the proxy
> <
> https://support.getpostman.com/hc/en-us/articles/360008893713-How-do-I-configure-Postman-to-work-through-a-proxy->
>
> , start JMeter's HTTP(S) Test Script Recorder,  copy the file you will be
> uploading to JMeter's "bin" folder
> <https://www.blazemeter.com/blog/recording-file-uploads-jmeter/>   and
> execute the request in Postman. JMeter will capture the request and store
> it
> under the  Recording Controller
> <
> https://jmeter.apache.org/usermanual/component_reference.html#Recording_Controller>
>
>
>
>
> --
> Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

Re: FILE Upload: TypeError: Cannot read property 'size' of undefined

Posted by "glinius@live.com" <gl...@live.com>.
It is impossible to come up with the comprehensive response without seeing
your request configuration, a short checklist:1. Make sure to copy the file
to "bin" folder of your JMeter installation or to provide the full path to
the file2. Tick "Use multipart/form-data" box in the  HTTP Request
<https://jmeter.apache.org/usermanual/component_reference.html#HTTP_Request>  
sampler 3. Make sure to use correct "Parameter Name" under the "Files
Upload" tab, it should be exactly the same as *name* parameter of the  file
input <https://www.w3schools.com/tags/att_input_type_file.asp>  In general
given you can successfully execute the request using Postman you could
record the request using JMeter, just  configure Postman to use JMeter as
the proxy
<https://support.getpostman.com/hc/en-us/articles/360008893713-How-do-I-configure-Postman-to-work-through-a-proxy-> 
, start JMeter's HTTP(S) Test Script Recorder,  copy the file you will be
uploading to JMeter's "bin" folder
<https://www.blazemeter.com/blog/recording-file-uploads-jmeter/>   and
execute the request in Postman. JMeter will capture the request and store it
under the  Recording Controller
<https://jmeter.apache.org/usermanual/component_reference.html#Recording_Controller>   



--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html