Problem: Attachments uploaded via RESTAPI still contain multipart content type header

I want to upload attachments to dedicated documents by the RESTAPI.
The following code tests the concept

{{velocity}}
{{html clean="false"}}
<script type="text/javascript">
var upload = null;
function uploadFile() {
  var file = document.getElementById("theForm").files[0];
  if(!file) return;
  var formData = new FormData();
  upload = new XMLHttpRequest();
  formData.append("anyName", file);
  upload.open("PUT",
     "/xwiki/rest/wikis/xwiki/spaces/Sandbox/pages/WebHome/attachments/"+file.name);
  upload.send(formData);
}
</script>
<form action="" method="post" enctype="multipart/form-data">
  <input id="theForm" type="file" accept="*.*" onchange="uploadFile();"/>
  <input value="Upload" type="button" onclick="uploadFile();" />
</form>
{{/html}}
{{/velocity}}

It uploads the selected file to the target position using the source file name as the attachment name.

BUT

The attachment still contains multipart content header (known from email)

Example:

Source file “testdata.txt”:

line 01 - abcdef
line 02 - ghijkl
line 03 - mnopqr

gives attachment content:

-----------------------------268387399540990973022739652154
Content-Disposition: form-data; name="anyName"; filename="testdata.txt"
Content-Type: text/plain

line 01 - abcdef
line 02 - ghijkl
line 03 - mnopqr
-----------------------------268387399540990973022739652154--

If the source is binary, e.g. an image, it results in

-----------------------------15659068953147169266861129780
Content-Disposition: form-data; name="datei"; filename="Kugeln.jpg"
Content-Type: image/jpeg

<binary information>
-----------------------------15659068953147169266861129780--

How can the additional boundary information be suppressed?

Note:
XWiki version 13.10.3 is used
The target URI contains an additional “/xwiki” in the beginning due proxy use.