Good, I really do not know how to ask the question, what happens to me is that when I try to upload a file with the tool, my browser has a memory crash, really do not explain it. Here is the function in Java Script.
$(function(){
var dragEntrada = document.getElementById('dragEntrada');
//tengo problemas cuando coloco esta función
var upload = function(files){
var formData = new FormData(),
xhr = new XMLHttpRequest(),
x;
for (var x = 0; x < files.length; x+1) {
formData.append('file[]', files[x]);
}
xhr.onload = function(){
var data = this.responseText;
console.log(data);
}
xhr.open('post', 'upload.php');
xhr.send(formData);
}
//
dragEntrada.ondrop = function(e){
e.preventDefault();
this.className = 'dragEntrada';
upload(e.dataTransfer.files);
}
dragEntrada.ondragover = function(){
this.className = 'dragEntrada dragover';
return false;
}
dragEntrada.ondragleave = function(){
this.className = 'dragEntrada';
return false;
}
}());
If you need another part of the code I will be waiting to place it, thank you very much.