on 08-06-2007 9:35 AM
Hi all,
I am using file upload with IWDResource in NW04s and while loading files with hebrew encoding I am getting gibrish when using
getResourceName()
method.
I also tried working with data and fileName properties - both giving null.
Any ideas?
Thanks,
Aviad
Hi Levy,
Use this code in action button for upload a file
Here up is a context attribute of type "com.sap.ide.webdynpro.uielementdefinitions.Resource"
It is to be bind with upload UI element property called "resource"
InputStream text = null;
int temp = 0;
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);
while((temp=text.read())!=-1)
{
op.write(temp);
}
}
op.flush();
op.close();
String path = file.getAbsolutePath();
wdComponentAPI.getMessageManager().reportSuccess(path);
}
catch(Exception e)
{
e.printStackTrace();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
Instead of regular hebrew chars I get squares and question marks.
Here is an example of a file name :
ת�?ק�?נ�?�? �?�?פ�?�?קצ�?�?ת �?�?ש�?ת �?ת�?�?�?�?�?ת.doc
Aviad
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.