Plupload upload blob data

141 Views Asked by At

I have plupload and I have microphone, I want to add and send audio I have recorded from plupload to server. How can I do it with close to zero needless actions ? I tried to use addFile, but it do not work

var uploader = new plupload.Uploader({
    runtimes : 'html5,flash,silverlight,html4',

    browse_button : 'pickfiles', // you can pass in id...
    container: document.getElementById('container'), // ... or DOM Element itself

    url : "upload.php",
    chunk_size : '1mb',

    init: {
        PostInit: function() {
            document.getElementById('filelist').innerHTML = '';

            document.getElementById('uploadfiles').onclick = function() {
                {
                    uploader.start();
                    $("#uploadfiles").hide();
                    return false;
                }
            };
        },

        FilesAdded: function(up, files) {
            plupload.each(files, function(file) {
                document.getElementById('filelist').innerHTML += '<div id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b></div>';
                $("#uploadfiles").show();
            });
        },


        Error: function(up, err) {
            document.getElementById('console').innerHTML += "\nError #" + err.code + ": " + err.message;
        }
    }
});

below is audio example I want to save from microphone

(437) [Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, Blob, …]
[0 … 99]
[100 … 199]
[200 … 299]
[300 … 399]
[400 … 436]
0

There are 0 best solutions below