You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by "michal-chudy-paylocity (via GitHub)" <gi...@apache.org> on 2023/10/09 08:55:19 UTC
[I] Cannot upload files in jMeter 5.6.2 [jmeter]
michal-chudy-paylocity opened a new issue, #6085:
URL: https://github.com/apache/jmeter/issues/6085
### Expected behavior
- I configure an HTTP Request sampler with multipart/form-data parameters
- I include a file in the Files Upload tab and provide the correct parameter mapping to the expected param name
- The file is located in the jMeter bin directory
- I run the test plan
Expected behaviour: The file is uploaded
### Actual behavior
- The request appears to execute correctly but the actual file is never uploaded
- The server receives no file bytes in the request body and the `files` parameter doesn't contain the filename
- The request in the view results tree contains the correct Content-Disposition and Content-Type headers
```
Content-Disposition: form-data; name="files"; filename="example.xlsx"
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
```
**The same request works as expected in jMeter 5.4.3**
### Steps to reproduce the problem
# Outline
As you can see from the description below, the file upload is broken in both, the jMeter proxy as well as when using an HTTP request sampler to upload it.
# Option 1 - record the request from the browser
1. Configure and run the jMeter proxy including the HTTPS Test Script Recorder and a Recording Controller
2. Configure your browser to use this proxy
3. Visit your website and upload the file
1. Check the request in the browser's developer tools
2. The file is correctly sent from the browser
3. The file is, however, removed from the request on the jMeter proxy
4. In your browser, revert the proxy settings back to the system proxy
5. Repeat the process of uploading the file
1. This time the file is correctly uploaded
## Option 1.1 - copy the recorded request and run it as a part of a test plan
1. Copy the recorded request from the session described above into a new test plan
2. Run the test plan (assuming you have the correct authentication cookies/headers present)
3. The file isn't uploaded
# Option 2 - verify the request in Postman and try to send the request from Postman via jMeter proxy
1. Download and install Postman and start a Postman proxy session
2. Try to upload your file to your website - Postman captures the request
3. Stop the Postman proxy
4. Create a new Postman request from the captured request and run the request
1. The file is uploaded correctly
5. In jMeter, turn on the jMeter proxy
6. Go back to Postman and configure Postman to use the jMeter proxy (File > Settings > Proxy)
7. Run the same request as in step 4 above
1. The jMeter proxy removes the file from the request
2. The request passes the proxy and reaches your server endpoint but the file isn't there
### JMeter Version
5.6.2
### Java Version
JDK 21 2023-09-19 LTS
### OS Version
Microsoft Windows 10 Enterprise, OS Version: 10.0.19045 N/A Build 19045
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Cannot upload files in jMeter 5.6.2 [jmeter]
Posted by "andrewkrgeo (via GitHub)" <gi...@apache.org>.
andrewkrgeo commented on issue #6085:
URL: https://github.com/apache/jmeter/issues/6085#issuecomment-2135218669
> @andrewkrgeo workaround for uploading is to set this to Java (advanced options in your http request) 
I set that, but still not working cause the relative file path in the configuration.
The workaroun i found works by now!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Cannot upload files in jMeter 5.6.2 [jmeter]
Posted by "andrewkrgeo (via GitHub)" <gi...@apache.org>.
andrewkrgeo commented on issue #6085:
URL: https://github.com/apache/jmeter/issues/6085#issuecomment-2135216124
At the end I found that the problem is related with JMETER 5.6.x does not support relative file paths when specifying it in a multipart/form-data POST request.
In a test of mine I changed it with absolute path, changed sample implementation to Java and UPLOAD worked again.
Still not working the recorder, giving always "file not found" java exception, so I need to add Upload sample manually after recording the first steps.
To get the absolute path I used a BeanShell script, preferring to have documents in the same path of JMX files:
`${__BeanShell(import org.apache.jmeter.services.FileServer; FileServer.getFileServer().getBaseDir();)}`
Give it a try,
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Cannot upload files in jMeter 5.6.2 [jmeter]
Posted by "cmyllis (via GitHub)" <gi...@apache.org>.
cmyllis commented on issue #6085:
URL: https://github.com/apache/jmeter/issues/6085#issuecomment-2134654680
@andrewkrgeo workaround for uploading is to set this to Java (advance options in your http request)

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Cannot upload files in jMeter 5.6.2 [jmeter]
Posted by "hrgsurya (via GitHub)" <gi...@apache.org>.
hrgsurya commented on issue #6085:
URL: https://github.com/apache/jmeter/issues/6085#issuecomment-5426237338
> [@andrewkrgeo](https://github.com/andrewkrgeo) workaround for uploading is to set this to Java (advanced options in your http request) 
Thanks and this really helped and now its working
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Cannot upload files in jMeter 5.6.2 [jmeter]
Posted by "andrewkrgeo (via GitHub)" <gi...@apache.org>.
andrewkrgeo commented on issue #6085:
URL: https://github.com/apache/jmeter/issues/6085#issuecomment-2134622123
Interested in workaround on 5.6.2 issue. I am facing the problem executing jmx tests on Azure Load Testing environment that upgraded jmeter server versions to 5.6.2 from 5.4.3 as reporte by @michal-chudy-paylocity.
thanks for the help!!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Cannot upload files in jMeter 5.6.2 [jmeter]
Posted by "cmyllis (via GitHub)" <gi...@apache.org>.
cmyllis commented on issue #6085:
URL: https://github.com/apache/jmeter/issues/6085#issuecomment-1997478688
I still have problems uploading in 5.6.3.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Cannot upload files in jMeter 5.6.2 [jmeter]
Posted by "cmyllis (via GitHub)" <gi...@apache.org>.
cmyllis commented on issue #6085:
URL: https://github.com/apache/jmeter/issues/6085#issuecomment-2006220994
@michal-chudy-paylocity Have you found any workaround to this? Or we cannot upload at all with the latest Jmeter?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org