one of my application based on J2EE, needs to eb upgraded to open office 2007 documents from the application web pages. But when tried to open the files, its opening in open-xml formats and says its corrupted before actually opening up. fyi, we use MS office 97-2003 documents MIME type as
doc=application/msword with this i am able to open the .doc files. But when tried with docx MIME types as
docx=application/vnd.openxmlformats-officedocument.wordprocessingml.document, the file is not opening properly and it asks to save the file again, which is wrong.
Can anybody please help me in this situation???
Appreciate an urgent help!
Can the client (an up-to-date version of MS Office, I assume?) open the files directly from a file system?
yes, users system is up-to-date with MS Office. When i try to open, suppose sample.docx, its opening fine. But while same docx file i want to open from the Application , it is not opening properly. It shows the file corrupted while opening
What process opens it? Have a look at task manager and see; my suspicioun is it may be IE itself rather than Office 2007. If your content type header is application/vnd.openxmlformats-officedocument.wordprocessingml.document it should work (assuming Office 2007 is properly installed).
If it is IE, check the content type again to make sure the mime type is correct.
Saurav Das wrote:It gives me the same error. The docx file is still corrupted. No luck
Please help me ..it's urgent!
OK, so you know its probably not the MIME type that is the issue, it sounds like the document itself is corrupted for some reason or another (just as Office is telling you). With regards to the download I suppose the only other possibility is you are not streaming the whole document? Other than that, I would turn my attention to how the document was created in the first place.