Greeting fellows! I have been using HTML5 application cache to create an offline web app recently. Everything works great on Chrome until I am implementing the "offline attachment download" function. Basically I have cached a servlet into the application cache. This servlet is actually a .jpg attachment with the following header:
HTTP/1.1 200 OK
P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Content-Type: application/octet-stream
Date: Fri, 11 Jan 2013 09:01:23 GMT
Content-Disposition: attachment; filename=MailAttachment.jpg
DownloadFileName: Snap1.jpg
Server: nginx/1.0.10
Cache-Control: private
Pragma: cache
Content-Length: 220005
What I try to achieve is when I visit this servlet offline, the image named "MailAttachment.jpg" will be downloaded (acutally from application cache) to browser-specified diretory. However, the thing is when I visited this servlet without network connection, the browser attempted to download "MailAttachment.jpg" but cancelled it immediately. When the content length is small enough (e.g. 1kb), the browser successfully downloaded the attachment. I suspect there are some improper headers in the cached servlet. Anybody has idea of the solution? Thanks very much in advance!