2

We have a java based application which can generate docx file and it pushes the content to the browser

We generate docx output in our application and send the byte data of the docx file to the browser window.

We set the content-type header in response to be "application/vnd.openxmlformats-officedocument.wordprocessingml.document"

On normal laptop or PCs, all browsers opens the file correctly (Chrome, IE, Firefox, Safari for Windows). But on IPad neither chrome nor Safari shows the file or gives an option to download the file. It shows a blank screen.

Has anyone seen this problem and a potential fix

Fazal
  • 2,991
  • 7
  • 29
  • 37

2 Answers2

3

It's been a while since I worked with iOS, so my answer may be outdated, but here goes...

From what I can see, your problem is probably that application/vnd.openxmlformats-officedocumrent.wordprocessingml.document is not supported on Apple platforms by default. Unless you have an application that has associated itself with that mime type you probably won't be able to open it at all on an iPad. You say that it works fine on laptop/pc, but does that include apple laptop/desktop? I suspect it won't work there either. If you are successfully opening it on a mac, then you probably have a program installed (outside of the base OS) that handles that type and has registered itself with the operating system.

My iPad/iPhone are getting elderly, and it's been a while since I developed for iOS, but unless they've added something in newer versions there's no generic "save to disk" function. You either have an application that handles it or you can't browse it.

However, given that you are dealing with the world of MS formats, and a great many folks screw up the mime types for these when serving them, one thing I would try before you give up is serving it with the wrong mime/type (application/msword). It's entirely possible that the existing handler for the old mime type has been updated to handle incorrectly served newer versions of the doc (this might be done to avoid bad user experience some of the time without officially committing to full support for the new type). The web (especially web browsers) is full of "makeup code"

If that works, it may not be reliable, and if you still feel like supporting apple platforms, it's probably still best to choose a secondary format with well established apple support like pdf, or the older .doc format. You can serve that instead when you detect an iPad or other apple device. Alternately you can advise your users that they will require a 3rd party app for Mac/iPad use.

Community
  • 1
  • 1
Gus
  • 6,719
  • 6
  • 37
  • 58
  • Hey Thanks for the asnwer. Our generated documents work on MAC Laptops without any issue. – Fazal Aug 31 '12 at 18:02
1

Use Microsoft Office Web Apps, free with SkyDrive.

upd.: currently you can try also preview version of MSO Web Apps with multitouch features.

Arman Hayots
  • 2,459
  • 6
  • 29
  • 53