GeeCON Prague 2014*
The moose likes Servlets and the fly likes pdf downloading problem with IE6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "pdf downloading problem with IE6" Watch "pdf downloading problem with IE6" New topic
Author

pdf downloading problem with IE6

Anand Ramasamy
Greenhorn

Joined: Oct 30, 2009
Posts: 6
Hi,
I have problem in using the "content-disposition: attachement" and "content-disposition: inline" header.
The problem is after clicking the open button in the dialogue box, the IE reports the attached error.

I have noticed the behaviour that the pdf file is stored inside the Temporary Internet Files and it is getting deleted immediately after clicking on the open button.

I checked in many forums and the advice is to use "Cache-control: public","Cache-control: max-age=60".
But still it is not working for me.
And I hv tried with many other combinations
like "Cache-control: private" and "Pragma: cache"
"Content-Type: application/pdf", "'Content-Length: file->size"
"Content-disposition: attachment; filename="'. file->filename"
"Expires: 0', 'Pragma: cache', 'Cache-Control: private"

This problem occurs only when we try to open the URL directly in the address bar and the same works fine with <a href='openPdf'>.

The application is running in Wesphere6.1
Please suggest some solution



[Thumbnail for error.JPG]

Samuel March
Ranch Hand

Joined: Oct 28, 2009
Posts: 39
personally, i have never used cache control for that

remove this
"Expires: 0', 'Pragma: cache', 'Cache-Control: private"
and it should operate for what i can see,

also , to help it you may need (usually do)
Content-Transfer-Encoding: Binary;

application/Octet-Stream; not application/pdf generally is a cure all used with "binary"(7/8 bit) for transfer encoding.

application/pdf is what you use when you want it to open in their browser.


...did you have the fish?!............................ No.
ujjwal soni
Ranch Hand

Joined: Mar 28, 2007
Posts: 403
There seems to be some problem with your internet explorer. Are you able to open this in other browsers ?


Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+919909981973>
"Helping hands are better than praying lips......"
Anand Ramasamy
Greenhorn

Joined: Oct 30, 2009
Posts: 6
Samuel March wrote:personally, i have never used cache control for that

remove this
"Expires: 0', 'Pragma: cache', 'Cache-Control: private"
and it should operate for what i can see,

also , to help it you may need (usually do)
Content-Transfer-Encoding: Binary;

application/Octet-Stream; not application/pdf generally is a cure all used with "binary"(7/8 bit) for transfer encoding.

application/pdf is what you use when you want it to open in their browser.


Hi,
Thanks for your response.
Your suggestion is working for "Content-Disposition : attachment" option.
But for ""Content-Disposition : inline", still getting the same error.
Anand Ramasamy
Greenhorn

Joined: Oct 30, 2009
Posts: 6
ujjwal soni wrote:There seems to be some problem with your internet explorer. Are you able to open this in other browsers ?


Hi ,
Thanks for your response.
It is working with the other browser. but is not a problem with IE also.
Because the same url is working when we have the url inside a anchore tag.

But it is not working when the url is directly used in the address bar of IE
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10425
    
    8

Anand boss wrote:

Please check your private messages for an important administrative matter


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

please check your private messages, you will find a message subjected ''try this one(file download)''. you will find the answer


Love all, trust a few, do wrong to none.
Anand Ramasamy
Greenhorn

Joined: Oct 30, 2009
Posts: 6
anusha chaitanya wrote:please check your private messages, you will find a message subjected ''try this one(file download)''. you will find the answer


Your code also works for me, But still I am getting errors for response.setHeader("Content-Disposition","inline; filename=filename.pdf"); option.
Anand Ramasamy
Greenhorn

Joined: Oct 30, 2009
Posts: 6
Hi All
We found the above problem is because of abobe and IE plug-in.
We resolved the issue by repairing IE and adobe.

Now we are facing a new issue with pdf downloading with the header response.setHeader("Content-Disposition", "inline; filename="filename.pdf") option.

Whenever it downloads a pdf file the adobe reports “There was an error opening this document. This file cannot be found”.

We are not sure whether the problem is with the servlet coding or with IE+PDF.

Please suggest some solution for this issue.

Thanks in advance.

Aditya Keyal
Ranch Hand

Joined: Dec 01, 2008
Posts: 71
One issue could be for your error could be the data file not getting streamed entirely. Try flushing your response stream before you close it.


- Aditya Webservices Blog
 
GeeCON Prague 2014
 
subject: pdf downloading problem with IE6