How to open a pdf file (generated dynamically at user request).

Posted on 2009-04-22
Last Modified: 2012-05-06
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 on the jsp page.
<a href="/chowgule/Documents/Reports_pdf/GEN_REG.pdf" target="_blank" >Download</a>

Open in new window

Question by:globalnest
    LVL 3

    Assisted Solution

    LVL 1

    Author Comment


    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.

    LVL 3

    Assisted Solution

    I've found this page:
    Check out point 4. This might solve your problem.
    if not, please tell me.
    LVL 1

    Accepted Solution

    I have found the solution for the problem. I t was due to secutrity issue of the AS/400 .
    Application needs to be given some read only access to the file system

    LVL 1

    Author Comment

    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

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    "That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved." Ralph Waldo Emerson Introduction: One of the wonderful things about the web is that it makes it s…
    Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now