on 02-06-2009 2:33 PM
Hi,
In a Web Dynpro for JAVA application, I just want to allow upload of .doc and .pdf files.
Any idea how to do this?
Many Thanks.
hi,
create a file upload ui element
in the onAction property of the ui elem bind a action UPLOAD
create two context elem
fname (bind to filename property of the ui elem)
fdata (bind to the data property of the ui elem)
in the UPLOAD method use th following code
IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPrivateMyView.IContextElement.FDATA);
IWDModifiableBinaryType btype = (IWDModifiableBinaryType) attributeInfo.getModifiableSimpleType();
IContextElement elem = wdContext.currentContextElement();
if(elem.getFData()!= null)
{
try
{
wdComponentAPI.getMessageManager().reportSuccess("File " + btype.getFileName() + " was uploaded ");
}
catch(Exception e)
{
throw new WDRuntimeException(e);
}
}
else
{
wdComponetAPI.getMessageManager().reportException("error in upload", true);
}
Regards
Jayapriya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
this is one way of uploading the file
/people/bertram.ganz/blog/2007/05/25/new-web-dynpro-java-tutorials--uploading-and-downloading-files-in-sap-netweaver-70
bvr
Edited by: bvr on Feb 6, 2009 6:05 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.