22.02.2023, 14:10
Use this JavaScript as a starting point:
Code:
async function send() {
var formdata = new FormData();
var url = '/scada-main/general/restore';
var el = document.getElementById('file');
formdata.append('file', el.files[0]);
var resp = await fetch(url, {
method: 'POST',
headers: { 'X-Requested-With': 'XMLHttpRequest' },
body: formdata
});
var res = await resp.json();
console.log(res);
}