on 06-22-2007 5:22 AM
Hi all
I have created a fileupload UI element and binded it to a resource attribute(dictionary type).
Now I want to retrieve data from the file that i upload.
How to go about it?? any pointers would be helpful...
Regards
Avinash
<b>Hi
Check this url
Uploading and downloading
Transport, Upload and Monitoring
http://help.sap.com/saphelp_nw04/helpdata/en/0d/13df3fa510031ee10000000a155106/frameset.htm
Regards
Chandran</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
well thanks ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi avinash,
check this link,
Regards,
vino
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1. Create an <b>File Upload UI element</b> and bind it with a <b>context attribute</b> say with name <b>up</b> and set the type as <b>Resource (dictionary type)</b>
and use the following <b>code</b>
InputStream text = null;
try
{
File file = new File(wdContext.currentContextElement().getUp().getResourceName());
FileOutputStream op = new FileOutputStream(file);
if(wdContext.currentContextElement().getUp()!=null)
{
text = wdContext.currentContextElement().getUp().read(false);
wdComponentAPI.getMessageManager().reportSuccess("text: "+text);
while((temp=text.read())!=-1)
{
op.write(temp);
}
}
op.flush();
op.close();
}
catch(Exception e)
{
e.printStackTrace();
}
Try selecting a <b>.txt</b> file for example
Regards,
Mathan MP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can access the inputstream of the file using the following code:
IWDResource res = wdContext.getCurrentContextElement()..getFileResource(); //FileResource is the name of the context attribute bound to the Resource property.
InputStream fileStream = res.read(false);
You can now use this input stream to read the contents of the file.
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
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.