0
votes

I am using POST request which uses Content-Type as "multipart/form-data; boundary= ------WebKitFormBoundaryQoBY2Xgnc8K2sTzQ".

Under Parameters Tab: Parameter Name:

------WebKitFormBoundaryQoBY2Xgnc8K2sTzQ
 Content-Disposition: form-data; name

Value:

------WebKitFormBoundaryQoBY2Xgnc8K2sTzQ
 Content-Disposition: form-data; name="fakeupload"
 
 C:\fakepath\software-development-life-cycle-planning.jpg

------WebKitFormBoundaryQoBY2Xgnc8K2sTzQ
 Content-Disposition: form-data; name="File"; filename="software-development-life-cycle-planning.jpg"
 Content-Type: image/jpeg
 
 
 ------WebKitFormBoundaryQoBY2Xgnc8K2sTzQ--

I have selected use multipart/form-data checkbox. Response is 500 Internal server error. How to handle this request.

Thanks in advance

1

1 Answers

0
votes

If you're not certain regarding how to properly build a file upload request I would recommend just recording it using JMeter's HTTP(S) Test Script Recorder

  1. Start JMeter's HTTP(S) Test Script Recorder
  2. If you're using HTTPS protocol - import ApacheJMeterTemporaryRootCA.crt into your browser, see HTTPS recording and certificates chapter of the HTTP(S) Test Script Recorder (was: HTTP Proxy Server ) documentation entry for more details
  3. Copy the file you will be uploading to "bin" folder of your JMeter installation, see Recording File Uploads with JMeter article for more details
  4. Upload the file in browser
  5. JMeter will capture the relevant HTTP Request sampler

If you want to continue with the manual setup - remove Content-Type header from the HTTP Header manager and everything from "Body Data" tab of the HTTP Request sampler. In the "Files Upload" tab provide relative or absolute path to the file, HTML input name and MIME type. And of course tick Use multipart/form-data box