este metodo es con ajax y php
function UploadImage() {
var formData = new FormData();
var File = $("#FilesForm")[0].files[0];
var FileName = $("#FilesForm")[0].files[0].name;
formData.append("I", File);
$.ajax({
url: "php/UploadFile_controller.php",
type: "Post",
data: formData,
processData: false,
contentType: false,
success: function (r) {
alert(r);
},
error: function (e) {
alert(e);
},
});
return false;
}