You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2020/12/25 18:13:06 UTC

[Bug 65027] New: HTTP Sampler/Files upload tab - auto detect MIME type of selected file

https://bz.apache.org/bugzilla/show_bug.cgi?id=65027

            Bug ID: 65027
           Summary: HTTP Sampler/Files upload tab - auto detect MIME type
                    of selected file
           Product: JMeter
           Version: unspecified
          Hardware: PC
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: HTTP
          Assignee: issues@jmeter.apache.org
          Reporter: nalexic@gmail.com
  Target Milestone: JMETER 5.4.1

Created attachment 37648
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37648&action=edit
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"

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 65027] HTTP Sampler/Files upload tab - auto detect MIME type of selected file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65027

--- Comment #1 from Felix Schumacher <fe...@internetallee.de> ---
Created attachment 37673
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37673&action=edit
Detect mimetype automatically, when no mimetype is given

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 65027] HTTP Sampler/Files upload tab - auto detect MIME type of selected file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65027

--- Comment #3 from eR@SeR <na...@gmail.com> ---
Created attachment 37686
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37686&action=edit
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 65027] HTTP Sampler/Files upload tab - auto detect MIME type of selected file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65027

Felix Schumacher <fe...@internetallee.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable
                 OS|                            |All
             Status|NEW                         |NEEDINFO

--- Comment #2 from Felix Schumacher <fe...@internetallee.de> ---
@all, should we change the behaviour to autodetect?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 65027] HTTP Sampler/Files upload tab - auto detect MIME type of selected file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65027

eR@SeR <na...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #5 from eR@SeR <na...@gmail.com> ---
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

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 65027] HTTP Sampler/Files upload tab - auto detect MIME type of selected file

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65027

Felix Schumacher <fe...@internetallee.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |FixedInTrunk

--- Comment #4 from Felix Schumacher <fe...@internetallee.de> ---
@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(-)

-- 
You are receiving this mail because:
You are the assignee for the bug.