cancel
Showing results for 
Search instead for 
Did you mean: 

File Upload, how to get full file name

srinivas_sistu
Active Contributor
0 Kudos

Hi Experts,

I have to get the complete file path when I use fileupload UI Element. but I am not able to achive this.

I used a File Upload UI, with filename property mapped to string variable filename and Data mapped to a binary variable filedata.

I tried to get the file name in below ways

1. wdContext.nodefile().currentfileelement.getfilename();

and

2. through modifiablebinary type also.

but in both cases I am getting only the file name, but not the complete path.

Is there any way that I can get the file path.

If I uplod a file in D drive (example.txt),

I am getting the file name as example.txt but I want to get it as D://example.txt

Please help me,

Regards,

Srinivas

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185086
Active Contributor
0 Kudos

Hi

What Stream are you using for read a file ?

InputStream inputStream = resource.read(false);

File filePath = new File(inputStream.toString());

wdComponentAPI.getMessageManager().reportWarning(filePath .getAbsolutePath());

Best Regards

Satish Kumar

srinivas_sistu
Active Contributor
0 Kudos

Hi,

Thank you for your reply. But the code given by you is giving the file path in the server.

but i want to get the file path in the client meachine. Is there any other way we can do this???

Waitng for your reply,

Regards,

Srinivas

former_member185086
Active Contributor
0 Kudos

Hi

Use [this|; for further help.

Best Regards

Satish Kumar

srinivas_sistu
Active Contributor
0 Kudos

Hi,

Thank you for your inputs. My problem solved. Now I am storing the files on Server and from there I am able to get the full apth of the file.

Regards,

Srinivas