Is it possible to add a method to retrieve the content of a File object to be able to send it with a POST method to the server ?
fileSelect := d.GetElementByID("import-file").(*dom.HTMLInputElement)
file := fileSelect.Files()[0]
...
resp, err := http.Post("/import/", "multipart/form-data", [the-file-content])
...
I currently do this in Javascript with:
var file = fileSelect.files[0];
var formData = new FormData();
formData.append('importFile', file, file.name);
var xhr = new XMLHttpRequest();
xhr.open('POST', '/import/', true);
...
Or any way to do this with another method?
Thanks.
Is it possible to add a method to retrieve the content of a File object to be able to send it with a POST method to the server ?
I currently do this in Javascript with:
Or any way to do this with another method?
Thanks.