For a project we are currently working on, we needed to generate, and send a Word 2010 document to the client. The document was generated by a great PL/SQL document generation tool called Doxxy, and was sent to the client using the wpg_docload package. This is a standard Oracle pl/sql package that can be used to download files, BLOBs and BFILEs.
Before the download, we set the Content-type in the http header as follows :
When sending the document to the client, we got the following popup in our browser :
So it looked like our browser didn’t recognized that this was an Word 2010 document.
Looking at the response header, using Firebug, we got the following result :
Somehow the content type for Word 2010 was overwritten to text/html; charset=utf-8.
So, time for the good old trial and error approach, which, after a while, paid off.
Before setting the response header to : owa_util.mime_header(‘….’,FALSE); we need to issue the following commands :
Now the code looks like this :
After adding these 2 lines, we got the correct mime type :
Many thanks to Willem Albert and Bjorn Fraeys for delivering the content for this blog !