on 10-09-2008 9:34 AM
Hi masters,
i need some inforamtion and documentation on file upload program in web dynpro java
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi surya,
You can follow this procedure to upload the file
i) Take One Context Attribute named as "D1" of Type "binary".
ii) Take one FileUpload UI Element in the Layout Tab.
iii) Bind FileUpload UI Element's data Property to the taken Context Attribute. Here it is "D1".
iv) Take one Button UI Element in the Layout Tab named "Upload" and in the Action of that Button write the following Code.
v) The following code Generates one Folder in the Server & inside that Folder given file is Uploaded.
File ff=new File("FolderXYZ"); // Creates One Folder with the given Name ( Here Folder name is "FolderXYZ")
ff.mkdir();
try
{
byte b[]=null;
IWDAttributeInfo objAttinfo=null;
IWDModifiableBinaryType binType=null;
File f=null;
FileOutputStream fos=null;
if(wdContext.currentContextElement().getD1()!=null)
{
b=wdContext.currentContextElement().getD1();
objAttinfo=wdContext.getNodeInfo().getAttribute(IPrivateAttachView.IContextElement.D1);
binType=(IWDModifiableBinaryType)objAttinfo.getModifiableSimpleType();
f=new File(ff.getName()+"
"+binType.getFileName());
fos=new FileOutputStream(f);
fos.write(b);
fos.flush();
fos.close();
}
objMessageManager.reportSuccess("File uploaded to server");
} catch (Exception e)
{
objMessageManager.reportException("Unable to upload file to server, error is:"+e,false);
return;
}
The Uploaded file is stored in the folder & that folder is stored in the Server's following Path.
<Your Server>\c$\usr\sap\J2E\JC00\j2ee\cluster\server0
You can access your Uploaded file from the following Path
<Your Server>\c$\usr\sap\J2E\JC00\j2ee\cluster\server0\FolderXYZ
Regards
Sagar Ingalwar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I know this topic is old but i'm currently developping the same kind of solution on an old version with Netweaver Developer Studio Version 2.0.19 (I can't use a more recent one because the Portal is also on old one).
So my question was, is it possible to save on onther place than the path usr\sap\J2E\... ?
I wonderred if i could save it on a netword drive or any other location.
Thanks for your help
Regards,
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi surya
check the following link
with regards
shant aloor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.