on 09-21-2008 12:23 PM
Hi Frndz..
How to upload a file using File upload feature in web dynpro into our specified location(usr/sap/Images/....),not into workspace r default path in server.
Thanks in Advance
Regards
Rajesh
Hi Rajesh,
Use below code on your "Upload" Action:
try
{
// Give full path of folder on server where you want to upload the file.
File file = new File("D:\\usr\\sap\\Images\\"+wdContext.currentContextElement().getResource().getResourceName().toString());
// D:\usr\sap\Images folder should present on server
FileOutputStream op = new FileOutputStream(file);
if(wdContext.currentContextElement().getResource()!=null)
{
text=wdContext.currentContextElement().getResource().read(false);
while((temp=text.read())!=-1)
{
op.write(temp);
}
}
op.flush();
op.close();
}
catch(Exception e)
{
wdComponentAPI.getMessageManager().reportSuccess("Error while uploading file : "+e.getMessage());
}
Thanks
Sandy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please go through the following link..
http://help.sap.com/saphelp_erp2004/helpdata/en/5a/90ff4cd0c8cd48a69b836e5e550880/frameset.htm
Regards
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
Please go through this help and explined here step by step on how to Uploading and Downloading Files in Web Dynpro Java for specific location.
Thanks
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.