Hello guys,
editor.upload = function (obj, callback) {
let formData = new FormData();
let xhr = new XMLHttpRequest();
formData.append('fieldName', obj.files[0]);
xhr.open('POST', 'upload/url');
xhr.send(formData);
xhr.onload = function () {
callback(xhr.responseText);
};
xhr.onerror = function (err) {
console.log(err);
}
}
how to get this obj ref?
Hello guys, editor.upload = function (obj, callback) { let formData = new FormData(); let xhr = new XMLHttpRequest(); formData.append('fieldName', obj.files[0]); xhr.open('POST', 'upload/url'); xhr.send(formData); xhr.onload = function () { callback(xhr.responseText); }; xhr.onerror = function (err) { console.log(err); } } how to get this obj ref?