oracle / cordova-plugin-wkwebview-file-xhr

Cordova Plugin for WebView File XHR
Universal Permissive License v1.0
138 stars 120 forks source link

formdata.set not working with file and name property already set #77

Closed FrankStierle closed 3 years ago

FrankStierle commented 3 years ago

We have problems with generated api code from swagger, like that:

formData.append("name", file);

Here the filename is not provided bu file is a File Object extended from Blob and has the filename already in the "name" property.

This will work when you change the code in the formdata-polyfill.js line 116:

From:

if (value && Blob.prototype.isPrototypeOf(value))

To:

if (value && !value.name && Blob.prototype.isPrototypeOf(value))

manish2788 commented 3 years ago

@FrankStierle Can you share a sample cordova app demonstrating the above mentioned issue?