offer fileupload and comments

This commit is contained in:
2018-01-10 21:09:08 +01:00
parent 6366bbc6a8
commit 665242eb4a
270 changed files with 35840 additions and 17 deletions
+16 -1
View File
@@ -29,4 +29,19 @@ $( function () {
shouldDisplay ? $( element ).fadeIn( 750 ) : $( element ).fadeOut( 750 );
}
};
} );
} );
function uploadFile(file, foreignID, tablename, callback){
var url = 'index.php/utils/fileupload/upload/' + foreignID + '/' + tablename;
var xhr = new XMLHttpRequest();
var fd = new FormData();
xhr.open("POST", url, true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
callback();
}
};
fd.append("userfile", file);
xhr.send(fd);
}