cancel
Showing results for 
Search instead for 
Did you mean: 

How to Upload a file File From Client to server Using Webdynpro

Former Member
0 Kudos

Hi

I am trying to Upload a file from a client to server.

I am using FileUpload UI element in webdynpro.

I want to Upload the File in a desired location in the

Server.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Write in wdDoInit()

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 in onAction()

String path = "C:
"; //specify the path to which u want to save the file in server.

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

FileOutputStream out = new FileOutputStream(file);

out.write(upload.getData());

Note: node – upload

Attributes – data(binary)

name(String)

    • Declare “IPrivateFirstView.IUploadElement upload;” globally.

Regards,

Piyush.

Message was edited by: piyush uthaman