Skip to content

Special characters in file name are replaced by "?" in HTTP Request Sampler #5758

@user412857

Description

@user412857

Expected behavior

HTTP Request Sampler should allow upload of files which name contains special characters, without changing the files name.

Actual behavior

In HTTP Request Sampler, when uploading a file which name contains special characters (for example: éèà), the characters are replaced by "?" in HTTP Request:

Content-Disposition: form-data; name="file1"; filename="nameWithSpecialCharacters_??.txt" Content-Type: text/plain Content-Transfer-Encoding: binary

This is when we use HttpClient4 implementation. With java implementation, they are replaced by "�" (REPLACEMENT CHARACTER).

Note that setting file.encoding system property to UTF-8 doesn't affect the behavior.

Steps to reproduce the problem

  1. Add HTTP Request in TestPlan.
  2. Select the POST method.
  3. Type in the Path.
  4. Select use multipart/form-data.
  5. Under the File Upload tab, enter the file path, Parameter Name, and MimeType. MIME Type examples: image/jpeg, image/png, text/plain. Choose a file which name contains special characters (for example: éèà)
  6. Save and run the test.
  7. In View Results Tree, Request Body, check that special characters are replaced by "?" or "�".

JMeter Version

5.5

Java Version

java version "11.0.13" 2021-10-19 LTS

OS Version

Microsoft Windows [Version 10.0.19044.2364]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions