on 10-14-2013 10:22 AM
Hi Experts,
I have a requirement to send the file path name from local machine to RFC.
But while doing so i am getting the path name as
/usr/sap/DHE/J40/j2ee/cluster/server0/test.xlsx |
but i need to pass C:\Users\test\Desktop\test.xls to the RFC.
Can anyone help me with this?
Regards,
Murali Krishnan
if i am not wrong, it is not possible, it is browser security restriction
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Murali,
You can write file to the server path as below and then perform the desired operations :
File file = new File(wdContext.currentContextElement().getFilesrc().getResourceName());
FileOutputStream fop = new FileOutputStream(file);
if(wdContext.currentContextElement().getFilesrc()!=null)
{
text=wdContext.currentContextElement().getFilesrc().read(false);
while((tmp=text.read())!=-1)
fop.write(tmp);
fop.flush();
fop.close();
String filepath =file.getAbsolutePath();
BufferedReader reader=new BufferedReader(new FileReader(filepath));
Regards,
Archana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Murali,
You can do couple of things to meet your requirement.
You will always get absolutePath of the file not the exact path of the file, since its store in WD resource.
So you can talaired the absolute path and send back to RFC.
Tailering can be done in this way.
1. Read the physical location of the file by going to portal server window file system.
2. then append pre url of portal server location to '/usr/sap/' an replace '/' with '\' and store it into temp attributes and bind this attributes to your RFC attributes .
Hope this will help.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How are you retrieving the file path?
The path seems to be server path.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.