globalnest
asked on
How to open a pdf file (generated dynamically at user request).
Hi all.
I am working on a web application. which is deployed on a websphere application server 6.0.
In my application a back end job generates a pdf file based on the user input. The file is genrated and placed on server. I get a logical path to access the file. This path is then indeed sent to a jsp page where it represents in form of link for user to open. If the client browser is mozila or safari, the file opens correctly. However, user do not get the same result if the browser is IE (6 or 7) . As the file is on server it do not shows a error page and tries to open the file and here the browser shows garbage data on the screen.
The attached code is for the path which I get from the server and then tries to access the link.
I have also tried using sendredirect on the servlet and window.open on the jsp page.
I am working on a web application. which is deployed on a websphere application server 6.0.
In my application a back end job generates a pdf file based on the user input. The file is genrated and placed on server. I get a logical path to access the file. This path is then indeed sent to a jsp page where it represents in form of link for user to open. If the client browser is mozila or safari, the file opens correctly. However, user do not get the same result if the browser is IE (6 or 7) . As the file is on server it do not shows a error page and tries to open the file and here the browser shows garbage data on the screen.
The attached code is for the path which I get from the server and then tries to access the link.
I have also tried using sendredirect on the servlet and window.open on the jsp page.
<a href="/chowgule/Documents/Reports_pdf/GEN_REG.pdf" target="_blank" >Download</a>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello SPARC-DESIGN,
Thank you for your time. I really appreciate the help as it was given when
it was most needed.
Thank you again for your help.
Rahul Ashar
Thank you for your time. I really appreciate the help as it was given when
it was most needed.
Thank you again for your help.
Rahul Ashar
ASKER
Thank you for reply.
I have not done any coding for downloading the file. The code shown on the link seems to work fine . However, If I pass on any other file say .pdf or .doc which is externally generated (i.e, not by the internal job ) then it works fine with the code I have given. Is it something related to browser setting? because, as I have mentioned earlier the files are working fine with mozila or safari but not with IE.
Rahul