2

I am newbie to jmeter. My scenario is to upload xml files. When I am uploading files using jmeter post, after receiving file on server I found that a header is added to the file. Due to this file not getting processed at server side as schema validation fails due to additional header information in file.

Is there any way, to upload file as it is. I don't want any extra information in file when it reaches the server.

Header attached that is added to the file

Host: 10.105.245.50:8081^M User-Agent: Apache-HttpClient/4.2.6 (java
1.5)^M ^M
--nbBxE1Z4dMr9-69ITAjV-L7Iw8gO0aEz^M  Content-Disposition: form-data; name="filePath"; filename="abc.xml"^M  Content-Type: text/xml^M  Content-Transfer-Encoding: binary^M
CaptainBli
  • 4,121
  • 4
  • 39
  • 58
vab050
  • 305
  • 1
  • 2
  • 10

2 Answers2

1

JMeter doesn't add anything to the file during multipart-post request. If your question is about --nbBxE1Z4dMr9-69ITAjV-L7Iw8gO0aEz - it's just a boundary of multipart request entity.

For certain XML files created on Windows OS using i.e. XML Nodepad or created from .NET are having first weird character which prevents these XML files from being read by non-Microsoft DOM and SAX parsers.

I would suggest the following:

JMeter won't add anything during file upload, perhaps your application does?

Community
  • 1
  • 1
Dmitri T
  • 159,985
  • 5
  • 83
  • 133
0

This might be helpful :

If it is a POST or PUT or PATCH request and there is a single file whose 'Parameter name' attribute (below) is omitted, then the file is sent as the entire body of the request, i.e. no wrappers are added. This allows arbitrary bodies to be sent. This functionality is present for POST requests after version 2.2, and also for PUT requests after version 2.3. See below for some further information on parameter handling.

from Http Request Manual

Paweł Dulęba
  • 1,048
  • 1
  • 13
  • 25