I used filesaver.js to allow me to download the file successfully.
var out = doc.getZip().generate({
type: "blob",
mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
}) //Output the document using Data-URI
saveAs(out,"Details.docx");
I need to call the downloaded file into backend code to save the file in S3 Bucket.
I'd be grateful for getting any assistance.