Document.Save to stream does not work

NP. Here is the Ajax call.

$.ajax({
    type: "POST",
    url: "/ExportToWord",
    data: { myData },
    success: function (response) {
        downloadUrl = '/Download?fileGuid=' + response.fileGuid
            + '&filename=' + response.fileName;
        var a = document.createElement("a");
        //safari doesn't support this yet
        if (typeof a.download === 'undefined') {
            window.location.href = downloadUrl;
        } else {
            a.href = downloadUrl;
            a.download = response.fileName;
            document.body.appendChild(a);
            a.click();
        }
    }
});