I'm working on Office Add-in project, I need to get current Office file and upload to our server. Below is upload file from File Browser to our server
var fdata = new FormData();
fdata.append('data', file);
fdata.append('totalFileSizeBytes', file.size);
fdata.boundary = '----boundary';
xhr.send(fdata);
And I got Office file info via function: Document.getFileAsync (https://dev.office.com/reference/add-ins/shared/document.getfileasync)
But I don't know how to convert File info from Document.getFileAsync to FormData. I tried read File info slice by slice then concat to an array and pass to FormData, but it wasn't success.