cancel
Showing results for 
Search instead for 
Did you mean: 

How to get location of file path.

Former Member
0 Kudos

I have uploaded the file but i need the path from where it is located.How to get it dynamically...

Thanks

Nitti

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Friend,

You can also try this.


IWDResource reSource ;
String path = reSource.getUrl(fileDownloadBehaviour);

Regards

Jeetendra.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Nitti,

Hopefully you have uploaded the file(say excel sheet) in the context (Va_TestResource) of your web Dynpro application in WDResource form.

You can convert this WDResource to byte array and then to iwdwebresource. Now using this you can get the URL for the file.

IWDResource res = wdContext.currentContextElement().getVa_TestResource();

if(res!= null){

try {

InputStream i_is_FileStream = res.read(false);

int i_int_NoOfBytes = i_is_FileStream.available();

byte [] byteArray = new byte [ i_int_NoOfBytes ];

int i_int_byteRead = i_is_FileStream.read(byteArray, 0, i_int_NoOfBytes);

IWDWebResource webRe = WDWebResource.getWebResource(byteArray, WDWebResourceType.XLS);

webRe.getURL();

} catch (IOException e) {

} catch (WDURLException e) {

}

}

Hope your issue is addressed

Regards,

Tushar Sinha

Former Member
0 Kudos

Hi,

try this

\WDURLGenerator.getResourcePath( wdComponentAPI.getDeployableObjectPart(),View.FILE_NAME);

regards,

Ramani