on 12-11-2008 9:35 AM
Hi,
Am creating a file in which gets saved in the server. Am trying to put it in a folder. Can any one please tell me how to create folders in the server.
Like:
//Adapter//Jar//Adapter.jar
where Adapter and Jar are folders...
Regards,
Krish
Hi,
please go through this pdf https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/607e9392-8167-2b10-b9a8-e0aa297e...
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a Lot...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use this running code, which i have created
public void onActionUploadFile(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionUploadFile(ServerEvent)
String FileName = "temp";//wdContext.currentContextElement().getDirectory();
InputStream input = null;
int i=0;
FileIncreament();
try {
String directory =".
temp
webdynpro
web
local
yh1245_ftp"+
"
Components
com.yash.yh1245.Upload
"FileNamewdContext.currentContextElement().getCounter();
boolean sucsss = new File(directory).mkdir();
if(sucsss){
wdComponentAPI.getMessageManager().reportSuccess("Directory Created ");
File file = new File(directory"
"wdContext.currentContextElement().getResourceURL().getResourceName().toString());
FileOutputStream fos = new FileOutputStream(file);
wdComponentAPI.getMessageManager().reportSuccess(file.getAbsolutePath());
FilePath = file.getAbsolutePath();
if(wdContext.currentContextElement().getResourceURL()!=null){
input = wdContext.currentContextElement().getResourceURL().read(false);
//wdComponentAPI.getMessageManager().reportSuccess("Resource is not null ");
while((i = input.read())!=-1){
fos.write(i);
}
}
fos.flush();
fos.close();
wdComponentAPI.getMessageManager().reportSuccess("File Uploaded on server directory ");
//wdComponentAPI.getMessageManager().reportSuccess("Created File Locaiton::"+file.getAbsolutePath());
//}
//Get the File Size
// IPrivateFTPUpload.IContextElement element = wdContext.currentContextElement();
// if (element.getResourceURL()!=null) {
// IWDResource resource = element.getResourceURL();
// element.getFileSize(this.getFileSize(resource));
// }
}
}catch(Exception e){
e.printStackTrace();
}
//@@end
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.