Created attachment 37648 [details] auto detect mime type Hello, When one or more files are selected to upload in HTTP Sampler/Files upload tab, the file path is generated but the MIME type isn't. IMO, it is better to auto-detect MIME type of selected file, than to type it manually every time. Jmeter 5.4.1 9d2ba68 Microsoft Windows 10 Pro 64-bit java version "1.8.0_251"
Created attachment 37673 [details] Detect mimetype automatically, when no mimetype is given
@all, should we change the behaviour to autodetect?
Created attachment 37686 [details] postman content-type Hi, I added the image of Content-Type column from Body/Form-data - Postman. What I noticed is: 1. If left blank, the placeholder "Auto" is shown. Postman automatically assigns a content type. Maybe to use the same approach in JMeter? ---- 2. If user starts to type in text box, suggestions will pop up and help him to choose one from the list. I guess Tika could be used to generate the list in JMeter. ---- Two more things to consider for improvement and possible solutions for auto-detect implementation.
@Nikola, could you test the next build from trunk or nightly? The other suggestions like adding "auto" for auto-detecting or auto-complete while typing are nice ideas, but I am not sure, how to implement those. Maybe it is a good idea to put them on their own enhancement issues :) commit 9326c3febe435307d36e904412593c2c2badf987 AuthorDate: Wed Dec 30 12:34:08 2020 +0100 Detect mime-type for files automatically when adding files to HTTP Sampler Bugzilla Id: 65027 --- .../jmeter/protocol/http/util/HTTPFileArg.java | 40 +++++++++++++++++++++- .../jmeter/protocol/http/util/TestHTTPFileArg.java | 2 +- .../protocol/http/util/TestHTTPFileArgs.java | 10 +++--- xdocs/changes.xml | 1 + xdocs/usermanual/component_reference.xml | 10 +++--- 5 files changed, 52 insertions(+), 11 deletions(-)
Hi Felix, It seems that autodetection works by scanning file path text box, not actual file that is browsed on disk, so user can type non existing file path and detection will work (MIME type gets filled) - which is fine by me. However, if user changes already provided file path, be it existing or not, MIME type box remains unchanged. Current implementation is not good enough since user has to remove MIME type text entirely in order to redetect it. I suggest that on every file path change, autodetection fills new or replaces current MIME type. (In reply to Felix Schumacher from comment #4) > @Nikola, could you test the next build from trunk or nightly? > > The other suggestions like adding "auto" for auto-detecting or auto-complete > while typing are nice ideas, but I am not sure, how to implement those. > Maybe it is a good idea to put them on their own enhancement issues :) Enhancement has been opened - https://bz.apache.org/bugzilla/show_bug.cgi?id=65139 Jmeter 5.5 acdb648 Microsoft Windows 10 Pro 64-bit java version "15.0.1" 2020-10-20
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5471