1var file = $('#fileInput').get(0).files.item(0); // instance of File
2$.ajax({
3 type: 'POST',
4 url: 'upload.php',
5 data: file,
6 contentType: 'application/my-binary-type', // set accordingly
7 processData: false
8});
9
1var fd = new FormData();
2fd.append('fname', 'test.wav');
3fd.append('data', soundBlob);
4$.ajax({
5 type: 'POST',
6 url: '/upload.php',
7 data: fd,
8 processData: false,
9 contentType: false
10}).done(function(data) {
11 console.log(data);
12});
13