Skip to Content
author's profile photo Former Member
Former Member

file upload problem

HI All,

I am facing problem with file upload UIElement.

If i want to select the file I have to must click the Browse button then I can upload the file.

If I type something in that text box it is entering into infinite loop.

if I type like one.jar or xyz.txt file in the text field there I am getting the problem.

How to keep that property as readonly or any other way to do it.

please help.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2005 at 06:13 AM

    Hi Mohammad,

    Ofcourse, you can type your file's name into the text box, provided you give the full path of the file. And there is no way you can disable only the text box of the upload element.

    This is my understanding of the Upload functionality :

    When you use the browse button to select a particular file, you are just specifying that the value for the binary attribute comes from the selected file. So browse button is just a utility for selecting the file and if you do not want to use it, you can type the exact path of the file like C:\Test\Sap\test.txt . Now only in the action that you have defined for file upload (using a button or link), the actual data is being fetched into the binary attribute. At that time, it reads the current value in the upload text box, looks for that file in the client m/c and copies the corresponding data into the binary attribute. In case that file doesnot exist, it goes into an infinite loop as in your case.

    Hope this helps,

    Best Regards,

    Nibu.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Mohammad,

      I don't think this functionality can be achieved by any means in webdynpro. Because :

      1) FileUpload doesnot have any events associated with it, which will let us initiate a validation on the value entered.

      2) Only when you access the binary attribute's data through wdContext.current<your element>.get<Binary_attribute>(), the data will be fetched from the client machine. This happens internally and cannot be controlled by us. Even using a try{} block won't help us in this regard.

      3) Above all, even if you get the entered value, you cannot access the client m/c from the server. You can use a string attribute and bind it to the FileUpload's 'fileName' property. Then after a value has been entered into the text box, you can retrieve the same through the string attribute. But as far as I know, there is no way in webdynpro to access the client machine's file from the server.

      So Mohammad, as far as I know, there is no way in WebDynpro to achieve this functionality.

      Best Regards,

      Nibu.

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.