cancel
Showing results for 
Search instead for 
Did you mean: 

Access Server File System from web dynpro

Former Member
0 Kudos

Hi all,

I have a table with two fields. In the first table column, I am using 'linktourl' ui element and it takes us to that specific url displayed.This is working fine.

But,in the second table column,When I click on a link, I have to give a link to a file server(for eg:
Server10\MyFolder...).

How can I give link to some server file system from web dynpro application?

If I use Class 'File', how can I go-ahead with this?Please give some thoughts.

Thanks

Anjana

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Please Refer this doc.

Creating A Directory On WAS Server at Desired Location and Uploading File in It Using Web Dynpro for Java

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/607e9392-8167-2b10-b9a8-e0aa297e...

Thanks

Abhilasha

former_member182374
Active Contributor
0 Kudos

Hi,

You can use IWDCachedResouce:

String fileName = "c:
myFile.jpg";

File f = new File(fileName);

FileInputStream fileInputStream = new FileInputStream(f);

IWDCachedWebResource cachedWebResource = WDWebResource.getWebResource(fileInputStream, fileName,

WDWebResourceType.JPG_IMAGE);

cachedWebResource.setResourceName(fileName);

String url = cachedWebResource .getURL();

set the url in to the linkToAction UI element and that's it...

Omri

Former Member
0 Kudos

Hi Omri,

Thanks for your immediate response.

I tried your suggestions like this onActionLinkToAction:

try{

String fileName = "C: Test.jpg";

File f = new File(fileName);

FileInputStream fileInputStream = new FileInputStream(f);

IWDCachedWebResource cachedWebResource = WDWebResource.getWebResource(fileInputStream,WDWebResourceType.JPG_IMAGE);

//IWDCachedWebResource cachedWebResource = WDWebResource.getWebResource

(fileInputStream, fileName, WDWebResourceType.JPG_IMAGE);(If I uncomment this, its giving error: cannot convert from IWDWebResource to IWDCachedWebResource)

cachedWebResource.setResourceName(fileName);

String url = cachedWebResource .getURL();

//Now where should I set this string url to in the LinkToActionUI element? I tried setting to property 'text'

}

catch(Exception e){

e.printStackTrace();

}

Thanks

Anjana

Former Member
0 Kudos

Can you please tel me how did u solve this proble..

even i am also facing same issue of :-

cannot convert from IWDWebResource to IWDCachedWebResource