Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pdf downloading problem with IE6

 
Anand Ramasamy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
error.JPG
Error message
[Thumbnail for error.JPG]
 
Samuel March
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There seems to be some problem with your internet explorer. Are you able to open this in other browsers ?
 
Anand Ramasamy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anand boss wrote:

Please check your private messages for an important administrative matter
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please check your private messages, you will find a message subjected ''try this one(file download)''. you will find the answer
 
Anand Ramasamy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic