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

UPLOADS

hi

How to upload excel file in webdynpro.

What are the steps needed to be done?

regards

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 Jun 15, 2005 at 07:09 AM

    hello Kamlesh,

    u can upload files to the server using upload UIE. for that u need to create a value node with 2 attributes - one of type binary and other of type string (one to store data and other for the file name).

    write this sample code in init()

    Iprivateview.IUpload upload = wdContext.createUploadElement();

    wdContext.nodeUpload().invalidate();

    wdContext.nodeUpload().bind(upload);

    IWDAttributeInfo info = wdContext.nodeUpload().getNodeInfo().getAttribute("data");

    IWDModifiableBinaryType binary = (IWDModifiableBinaryType)info.getModifiableSimpleType();

    binary.setFileName(upload.getName());

    write this in onAction of the button which uploads the file.

    File file = new File(upload.getName());

    FileOutputStream out = new FileOutputStream(file);

    out.write(upload.getData());

    hope this might help u.

    regards,

    Piyush.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 15, 2005 at 07:18 AM

    Hi Kamlesh,

    you can use the upload UI Element to upload any kind of files from the client system to the server.You need to create a value node with 2 attributes of type binary and string respectively and map it accordingly to the "data" and "filename" properties of the UI Element.make the instance of the value node and create a simple type of that attribute.

    Iprivateview.IUpload upload = wdContext.createUploadElement();

    wdContext.nodeUpload().invalidate();

    wdContext.nodeUpload().bind(upload);

    IWDAttributeInfo info = wdContext.nodeUpload().getNodeInfo().getAttribute("data");

    IWDModifiableBinaryType binary = (IWDModifiableBinaryType)info.getModifiableSimpleType();

    binary.setFileName(upload.getName());

    hope this will help.

    Regards,

    Shyam

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi shyam,

      you have mentioned the code for uploading the file to server.but could you tell me how i can upload one file(excel,pdf,text to sapr/3 application server ar any text object.

      kindly give me some sample code also.

      thanx in advance.

      regards,

      PP

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.