cancel
Showing results for 
Search instead for 
Did you mean: 

How to download PDF file using FileDownload UI element?

Former Member
0 Kudos

hi snd expert,

currently i manage to map the filedownload data element with the file that i upload. but then i wish to get the url of the file like

http://192.16.8.124:50100/webdynpro/dispatcher/local/UploadEmailPjt/UploadEMail/~wd_key568_119692299...

instead of

../../local/UploadEmailPjt/UploadEMail/~wd_key568_1196922994719/testing.pdf?sap-wd-download=1&sap-wd-cltwndid=94299473a3c511dc841300145e5a17d5&sap-wd-appwndid=94299474a3c511dcbd5f00145e5a17d5&sap-wd-norefresh=X

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

If you want to download PDF use this ..

1: create one context attribute of type binary, say srcPdf

2: Insert FileDownLoad UI Element and bind it's data property to "srcPdf"

and write this code in wdDoinit() method

File f=new File(<FileName>);

FileInputStream fis=new FileInputStream(f);

ByteArrayOutputStream bos=new ByteArrayOutputStream();

int length;

byte[] part=new byte[10*1024];

while((length=fis.read(part))!=-1)

{

bos.write(part,0,length);

}

fis.close();

wdContext.currentContextElement().set<srcPdf>(bos.toByteArray());

Regards

LakshmiNarayana

Former Member
0 Kudos

Hi,

Pl have a look at this blog /people/bertram.ganz/blog/2007/05/25/new-web-dynpro-java-tutorials--uploading-and-downloading-files-in-sap-netweaver-70

Regards

Ayyapparaj