Skip to Content
author's profile photo Former Member
Former Member

Read a pdf via path in WebDynpro

Hi all,

we need read a pdf via the path (not url). Therefore we open the pdf on the server with "FileInputStream" to a and fill a byte-array.

If we write this array with "FileOutputStream" everything went fine. We can read the generated output with AcrobatReader.

But if we try to send the ByteArray to a client with a "HttpServletResponse.getOutputStream" the automatically starting AcrobatReader tells us, that out file ist corrupt.

Every suggestion ist welcome, thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2005 at 08:03 PM

    Couldn't you use a FileDownload UI element instead?

    Armin

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      @Armin

      seems to be a good idea. I already use a FileUploadUI to transfer files onto the server. Until know I doesn't consider to use a FileDownloadUI. I will check, if it fits to my case.

      Regards

  • author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2005 at 08:41 PM

    Hi,

    have you set the content type of the httpservletresponse correctly...before writing the binary data to the stream....

    Thanks & Regards,

    Renjith.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.