Hi,
I need to upload big text to server as a file.
I found some solution, and it works, but I need to do the same via webix.ajax() or uploader.
Is it possible?
The solution found in stackOverflow:
var logContent = $$("logsArea").getValue();
var logContentBlob = new Blob([logContent], {type: 'text/plain'});
var formdata = new FormData();
formdata.append("file", logContentBlob, "syslog.txt");
var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};
fetch("/api/syslog/export", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));