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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 13, 2011 at 06:22 AM


    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 a comment
    10|10000 characters needed characters exceeded

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.