This commit is contained in:
Sébastien Thuret 2021-10-25 10:33:49 +02:00
parent 73ebb96171
commit b97134ac07
No known key found for this signature in database
GPG key ID: 4742E2D66933BB08

View file

@ -324,12 +324,12 @@ document.addEventListener('DOMContentLoaded', function(){
let translateFileRequest = new XMLHttpRequest();
translateFileRequest.open("POST", BaseUrl + "/translate_file", true);
translateFileRequest.setRequestHeader("Content-type", "multipart/form-data");
let formdata = new FormData();
formdata.append("file", this.inputFile);
formdata.append("source", this.sourceLang);
formdata.append("target", this.targetLang);
let data = new FormData();
data.append("file", this.inputFile);
data.append("source", this.sourceLang);
data.append("target", this.targetLang);
data.append("api_key", localStorage.getItem("api_key") || "");
this.loadingFileTranslation = true
@ -339,7 +339,7 @@ document.addEventListener('DOMContentLoaded', function(){
}
}
translateFileRequest.send(formdata);
translateFileRequest.send(data);
}
}
});