Skip to Content

Event on browse button in fileupload uielement

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Dec 13, 2011 at 06:22 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 13, 2011 at 12:53 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded