dimanche 17 septembre 2017

How to send audio file as a FormData using ajax

I have to edit sound on the web and upload to server. The code for upload as below.

    var blob = new Blob([encodedWave], {type: encoding});

    var data = new FormData();
    data.append('file', blob);

    $.ajax({
        url :  "videoconverter.php",
        type: 'POST',
        data: data,
        contentType: false,
        processData: false,
        success: function(data) {
          alert("boa!");    
        },    
        error: function() {
          alert("not so boa!");
        }
    });

But for the php file it cannot retrieve any value. Here, is my Blob enter image description here




Aucun commentaire:

Enregistrer un commentaire