Coder Social home page Coder Social logo

Comments (3)

silkimen avatar silkimen commented on August 15, 2024

I'm not sure if this will help, but did you try to use the ponyfilled version of FormData which is shipped with this plugin?
See https://github.com/silkimen/cordova-plugin-advanced-http/wiki/Web-APIs-required-for-Multipart-requests for details.

e.g. using

const fd = new cordova.plugin.http.ponyfills.FormData();
const file = new File([audioBlob], 'some_name.mp3'); // audioBlob is passed to this function
fd.append('file', file);
// Pass fd to `sendRequest`

from cordova-plugin-advanced-http.

jsoldi avatar jsoldi commented on August 15, 2024

I don't know about that plugin, but I ended up saving the native File type in my index.html file like this:

<script>
    // Save native File before cordova-plugin-file overwrites it
    window.NativeFile = window.File;
</script>

Then I can create a native file that I can pass to my form data like:

new (window as any).NativeFile([audioBlob], 'some_name.mp3', { type: 'audio/mpeg' });

from cordova-plugin-advanced-http.

silkimen avatar silkimen commented on August 15, 2024

Okay, thanks for the feedback! I am closing this as your problem seems to be solved. Feel free to create a new ticket if you face another problem. 👍

from cordova-plugin-advanced-http.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.