cancel
Showing results for 
Search instead for 
Did you mean: 

Reg : Download file from KM

Former Member
0 Kudos

Hi All,

I am trying to download file from KM. I tried following code but it is not taking path into FileInputStream.

String resourcePath = "http://abc.xyz.com:50000/irj/go/km/docs/documents/risha/ XYZ 20409.doc";

IWDResource resource;

String name = "XYZ 20409.doc";

String path = resourcePath;

InputStream stream;

try {

stream = new FileInputStream(path);

resource = WDResourceFactory.createResource( stream, name, WDWebResourceType.DOC, true);

stream.close();

wdComponentAPI.getWindowManager() .createNonModalExternalWindow( resource.getUrl( 0), name).show();

//store resource object in context attribute 'FileResource'

wdContext.currentCtx_va_FileDataElement().setCtx_va_FileResource(resource);

} catch (FileNotFoundException e) {

e.printStackTrace();

} catch (IOException e) {

e.printStackTrace();

}

Please helpme out.

Thanks

Risha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Create a linkto url ui element and provide the url, with out any code you will be able to download.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi ,

Is it possible to download from Km ?

Thanks

Risha

Former Member
0 Kudos

Hi Ayyapparaj ,

My exact requirement is to download the file from KM and get the file name from that URL. and send it to RFC.

I am getting URL from KM like

http://abc.xyz.com:50000/irj/go/km/docs/documents/app/proposal%20-%20abpb%20arrb%20020409.doc

From this URL ,I need only filename.How to replace special characters like %20 for space......etc..

But User will give the file name in different characters and formats.

Is there any other way to get the file name?

Please helpme out.

Thanks

Risha.

Answers (2)

Answers (2)

Former Member
0 Kudos

Please see the below thread

former_member185086
Active Contributor
0 Kudos

Hi

Try this

1.[How To Upload/Download Files in WDP from KM|;

2.[Km Files|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/05c7e2ae-0a01-0010-ca98-fe42dbe05045]

3.[KM|/message/1031883#1031883 [original link is broken];

Hope it help

Regards

Satish Kumar

Former Member
0 Kudos

Hi ,

Thanks for Reply.

But I need only Dowloading file from KM functionality.

Thanks

Risha