on 10-22-2008 9:07 AM
Hello All,
I need one clarification, When we upload file residing in the Local system in WD, where this file present i.e., cache or in other place.
I have one scenarion where we will upoad file and send to other server through webservice, if it fails where this file present.
Thanks and regards,
CSP
Hi Pradeep Kumar
Just go through this link.It will be help you
Regards
Ruturaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi!
the file get stored on server from client.
for more details check this link
http://help.sap.com/saphelp_erp2004/helpdata/en/5a/90ff4cd0c8cd48a69b836e5e550880/frameset.htm
regards
vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
When you upload file it resides into WDResource cache of WD
in your case either you can upload file into context and transfer it to the server or directly write to the server ...by useing following code.
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
}
fore more detail just look into this link
Thanks
Edited by: Anup Bharti on Oct 22, 2008 10:36 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It will reside on the server. Better you create a directory on server and then upload file to that directory. Go through the following document to create a directory on the server.
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/607e9392-8167-2b10-b9a8-e0aa297e88c6]
Regards
Raghu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.