File Transfer Plugin adds "X-Requested-With: XMLHttpRequest" Header ONLY on iOS

Hi, I’m writing an app that uploads pictures to my ownCloud server with the File Transfer Plugin which internally uses a PUT request. Here is the relevant part of my code:

import {Transfer} from "ionic-native";
upload(imgToUpload) {
  let transfer = new Transfer();
  let URL: "https://username:password@owncloud.../remote.php/webdav/folder/"
  let options = {
    httpMethod: "PUT"

  transfer.upload(imgToUpload, URL, options, true).then(
    (succ) => {},
    (err) => {console.log(err.http_status+" "+err.body);}

The whole thing works on Android, but on iOS get the following error from ownCloud:

401 <?xml version="1.0" encoding="utf-8"?> 
  <d:error xmlns:d="DAV:" xmlns:s="">
    <s:message>Cannot authenticate over ajax calls</s:message>

It seems that the error originates here in the ownCloud source code. Apparently the File Transfer Plugin adds the X-Requested-With: XMLHttpRequest header, but I don’t understand why this only happens on iOS and not on Android.

Does anyone know how to fix this?
Thanks in advance!

The platform implementations of obviously are different. Did you look at the Android calls to see if the header was present there?

You could fork the cordova-plugin-file-transfer and remove this line: This would probably help, but maybe cause all kinds of other problems.