cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a file filter in FileUpload UI component

Former Member
0 Kudos

Hi

2 Questions.

1)Is it possible to set a file filter in FileUpload UI component in Webdynpro java?I want only the .xml files to be shown in the browse window.

2)Can I get the absolute path of the file that has been selected?The method getResourceName()(Interface IWDResource) gives only the file name but I want the entire path so that I can write data from the context into the local file.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I am trying to write data from the context into a local file.

For that the user has to select the file from the browser window and then I take the absolute path of the file and stream the data(String)into that file and save it locally.

Is there an alternative in webdynpro other than the fileupload to get a file browser window?

Former Member
0 Kudos

Sourav,

Still cannot understand you requirements completely, sorry. Namely, what does "save it locally" mean?

There are 2 possible scenarios:

1. User submits file via FileUpload control and you save it locally at server (probably, with some pre-processing). Here no path information required.

2. User submits file, you process it and return result (also file) back to user. Well, actually there is no way to do second part of this task automatically (save it at user computer). You must first accept user file via FileUpload control, then process it and finally show FileDownload control to let user download modified version. Again, path information is unnecessary here.

VS

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi sourav,

I think its not possible while selectiong only the .xml files,

but you can stop uploading the files no other than .xml files,

for this check the file extesion is equals to .xml or not

regards,

naga raju

Former Member
0 Kudos

Sourav,

<i>1)Is it possible to set a file filter in FileUpload UI component in Webdynpro java?I want only the .xml files to be shown in the browse window.</i>

This is impossible. There is no such option in WD, and some WD client environments, like IE 5.5+ does not provide such option either.

<i>2)Can I get the absolute path of the file that has been selected?The method getResourceName()(Interface IWDResource) gives only the file name but I want the entire path so that I can write data from the context into the local file.</i>

No, this is also not supported. However, what are you trying to do? Get absolute path on client and...? Write to it on server? Write to it on client?

VS