cancel
Showing results for 
Search instead for 
Did you mean: 

Read a pdf via path in WebDynpro

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

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

Thanks & Regards,

Renjith.

Former Member
0 Kudos

@Renjith

I use "application/pdf". Are there other possibilities?

Regards

Former Member
0 Kudos

Couldn't you use a FileDownload UI element instead?

Armin

Former Member
0 Kudos

@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