I need to upload a part of a file (only the first MB). I've created a PHP script which uploads the whole file. The data (formData
Object) is passed by a ajax call.
My idea would be now to split the file with javascript (jquery). Is there any solution for my request?
Current code:
function start(a){
//var fSize = $('#fileUpload')[0].files[0].size / 1024;
var formData = new FormData();
formData.append( 'fileUpload', $('#fileUpload')[0].files[0] );
//AJAX
$.ajax({
url: 'script.php',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success: function(msg){
alert(Win: + msg);
},
error: function(bla, msg){
alert(Fail: + msg);
}
});
}