I have a web-app that uses a servlet for downloading files from a repository--PDF, Office, images, zip, etc. It works with desktop browsers--IE, Firefox, Chrome, and Safari--on their various platforms. It also works fine with Firefox from Android (2.3 and 4.x tested). However when I try with Android's default WebKit browser, the servlet fails immediately with org.apache.catalina.connector.ClientAbortException (so says the stderr log).
The servlet is sending proper headers, including the correct MIME type, Content-Disposition attachment, file size, etc. I even took to adding the file's name as the last GET parameter. No dice. Safari on iPad, iPhone, and iPod Touch also fail. Although I don't have one with me at this moment to test, I suspect their failure is also caused by a ClientAbortException: Safari is also WebKit and *I've Google'd numerous complaints about this exception when using mobile WebKit browsers*. While I can tell Android users to try Firefox, there is no Firefox for iPhone. I'm expecting a file to open in a local viewer app, like Acrobat Reader, QuickOffice, Pages, etc. I can open files in these apps via Firefox, an email client, or via the WebKit browser when viewing a directory listing in my public_html directories and similar locations. I suspect this is a problem with mobile WebKit, and that circumventing the abort might be a "bad thing" even if it's possible. However I thought I'd inquire here if there is a Tomcat way around it. If not, it seems my alternatives are (1) use Java Mail to mail the user the file, since mail apps open their attachments; and (2) write iOS and Android apps file query and downloading. Neither prospect thrills me. Thoughts? -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, *Doctor Faustus* (v, 121-24)