Skip to Content
author's profile photo
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

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

    Couldn't you use a FileDownload UI element instead?

    Armin

    Add 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
    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 comment
    10|10000 characters needed characters exceeded