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

how to read the data of a file using upload option....

Hi Frndz..

As per my requirment , i need to provide a upload UI to the user , so he can select file to be upload whenever user select the file n clicks on upload button i need to read the data of that fiel that user selects.

I have a solutions for this in JSP/JAVA , but i was unable to handle this in web dynpro..c this link in jsp ..

http://www.roseindia.net/jsp/fileupload.shtml

Thanks in Advance..

Regards

Rajesh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2008 at 04:17 AM

    Hi,

    Create a Value attribute (resource) of type Resource, bind it with the property of File Upload UI element.

    On action place the code and Deploy the application

    byte[] bytes = new byte[ 1024];
    
    FileOutputStream out = new FileOutputStream( new File( <path in server>));
    InputStream in = resource.read( true);
    int len;
    while( ( len = in.read( bytes)) > 0)
    {
    	out.write( bytes, 0, len);
    }
    in.close();
    out.close();
    
    

    Regards

    Vinod V

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2008 at 04:26 AM

    Hi,

    You can refer to the following How to guides (upload of files)

    Tutorials & Samples for Web Dynpro Java

    Regards

    Pankaj Prasoon

    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.