I have a web app that takes in variables from the client and generates a docx file where it should then return that to the client. My Java side works correctly and I can see a bunch of binary when I write the response to the console on the client side, however the client will not open this response in ms-word as I would like it to. I’ve set the ContentType to application/vnd.ms-word and the Content-Disposition to attachment and specified the filename, but no luck.
Anyone know what the problem might be?
dojo.xhrGet({
url : "file.docx",
content : {
...
},
load : function (response, ioArgs) {
console.log("Successful xhr - Response:", response);
window.open(response);
return response;
},
error : function (response) {
...
}
});
I ended up using dojo.io.iframe.send(). A problem I ran into is that the iframe was not resolving itself, blocking any future iframes from being executed. I check for a previous iframe and call iframe.cancel() if one exists prior to calling dojo.io.iframe.send().