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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Karuna Lingham
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
Reply | Threaded
Open this post in threaded view
|

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

glinius@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
Reply | Threaded
Open this post in threaded view
|

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

Karuna Lingham
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 [hidden email] <[hidden email]> 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


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]