cancel
Showing results for 
Search instead for 
Did you mean: 

Event on browse button in fileupload uielement

prathamesh_gandhi
Participant
0 Kudos

Hi All,

I have a requirement where i am upload the file, as i select the file form browse there is one more filed where user can put the dummy file name i have to default that filed with the selected file name.. how can i meet this requirement ?? is there any event on the browse button where i can write my code.

and also i want to allow all file formats to be attached , which format should i assign to the object in OAC2??

Please help me to sortout this.

Thanks In Advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The Browse Button isn't even generated by Web Dynpro for the FileUpload. This is built on the client side by the browser. In Web Dynpro we only generate the HTML <input type=file>. Also from the online help:

Due to browser restrictions that are unrelated to Web Dynpro ABAP, the previously entered data path might disappear when a FileUpload UI element is clicked. In newer versions of the browser, it is therefore impossible to enter the file name in the entry field. The field always remains empty. Neither are any possible restrictions displayed, for example, file names or file name extensions. The selection of the file name is therefore only possible in new browser versions using the Browse... button. You cannot enter the file name manually (using the keyboard or copy and paste functions) or by setting the file name from the back end (directly or using context binding).

These are security restrictions put in place to make sure that only the user is selecting the file for upload. This way you can't script and grab a file the user doesn't want you to have. You can imagine how dangerous that would be on the internet.

arjun_thakur
Active Contributor
0 Kudos

Hi,

I don't think you could capture the event generated on click of browse button. You should fill the other input field in the action handler of some action like in the action handler of the upload button.