我正在尝试在浏览器中打开一个 word 文档。因此,当用户想要查看它时,我应该能够在浏览器本身中打开文档。有没有办法做到这一点?
现在的代码:
response.addHeader("Content-Type", "application/msword; charset=utf-8")
response.addHeader("Content-disposition", "inline; filename="+"\"testdoucment.doc\"")
response.setContentLength(content.getBytes().length)
response.outputStream<<content.bytes
response.outputStream.flush()
response.flushBuffer()