on 08-13-2008 6:41 PM
Hi Frndz..
As per my requirment , i need to provide a upload UI to the user , so he can select file to be upload whenever user select the file n clicks on upload button i need to read the data of that fiel that user selects.
I have a solutions for this in JSP/JAVA , but i was unable to handle this in web dynpro..c this link in jsp ..
http://www.roseindia.net/jsp/fileupload.shtml
Thanks in Advance..
Regards
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a Value attribute (resource) of type Resource, bind it with the property of File Upload UI element.
On action place the code and Deploy the application
byte[] bytes = new byte[ 1024];
FileOutputStream out = new FileOutputStream( new File( <path in server>));
InputStream in = resource.read( true);
int len;
while( ( len = in.read( bytes)) > 0)
{
out.write( bytes, 0, len);
}
in.close();
out.close();
Regards
Vinod V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vinod..
Thnaks for ur prompt reply,but my requirment is not to read the file @ server, as per my requirment we have to provide a upload UI to user ,so user can selects a file on his machine(means @ client mechine), so i need to read the file which he selects n pass these data to RFC.
In jsp/java we can catch a selecte file like this
"String contentType = request.getContentType();
DataInputStream in = new DataInputStream(request.getInputStream());"
how it could be in WDP
Regards
Rajesh
Once you use the Upload UI element and bind the Resource property with an value attribute of type Resource, During execution it prompt for select file wizard and on selection of a file, it gets as a resource. Make use of this Resource on a button action to store in server side.
Whats the use of RFC here and its Type of parameter in your application?
Regards
Vinod V
User | Count |
---|---|
81 | |
25 | |
12 | |
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.