I am using JMeter to perform file upload test.
I have created an HTTP request to upload the file but I am getting 400 Error.
Following is the data I am using to perform the test.
- The file type is CSV and verified the same by keeping the file in Jmeter bin folder and outside as well.
- HTTP request which is getting sent to the Server.
"POST http://staging.server.com/app/abc/upload/nextech"
POST data: --hHjQWI9uUQ3sP-EYqUUzibD0nxN07P Content-Disposition: form-data; name="file"; filename="appointments - Sheet1.csv" Content-Type: multipart/form-data Content-Transfer-Encoding: binary
--hHjQWI9uUQ3sP-EYqUUzibD0nxN07P--
Cookie Data: JSESSIONID=F12BCDF8EC1BD4B52E18716A174FB347
Request Headers:
Connection: keep-alive
Accept: /
Origin: http://staging.server.com
X-CSRF-TOKEN: 44cf8a25-2157-4086-bcd6-828b827f3efa
Content-Type: multipart/form-data;boundary=----WebKitFormBoundary9wyB2Bt4GSs1EYtR
Referer: http://staging.server.com/app/schedule Content-Length: 952
Host: staging.server.com
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_171)".
File Path in the request is: "D:\Jmeter3\apache-jmeter-3.2\bin\appointments - Sheet1.csv", ParameterName: file, MIME Type:multipart/form-data
Request Header:
Accept /
Origin http://staging.beepermd.com
X-CSRF-TOKEN ${extractedCSRF}
Content-Type multipart/form-data;boundary=----WebKitFormBoundary9wyB2Bt4GSs1EYtR
${extractedCSRF}