on 03-16-2006 5:39 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.