ob1kanobee
Programmer
Hello,
I am trying to incorporate the escape/unescape function written in javascript within a java process page.
It seems simple enough, but I cannot get it to work.
Code:
<script language="javascript">
function doEscape(sFileName) {
if(sFileName != null && sFileName != "") {
return escape(sFileName);
}
</script>
Here's the Java code calling the javascript function. The getAbsolutePath returns me the path and filename being imported. I need for users to be able to upload filenames with ascii and non-ascii characters as well as punctuations, etc.:
<%
sFilenameLocal = fCustomerSat.getAbsolutePath();
sFilenameLocal = %>doEscape(<%=sFilenameLocal%>)<%;
System.out.println("FileName is: " + sFilenameLocal);
%>
I keep getting an "incompatible types" error even though the variable sFilenameLocal is a string variable.
I also tried putting quotes around the java sFilenameLocal variable with basically the same results.
What am I missing here? Any help will be appreciated. TIA
I am trying to incorporate the escape/unescape function written in javascript within a java process page.
It seems simple enough, but I cannot get it to work.
Code:
<script language="javascript">
function doEscape(sFileName) {
if(sFileName != null && sFileName != "") {
return escape(sFileName);
}
</script>
Here's the Java code calling the javascript function. The getAbsolutePath returns me the path and filename being imported. I need for users to be able to upload filenames with ascii and non-ascii characters as well as punctuations, etc.:
<%
sFilenameLocal = fCustomerSat.getAbsolutePath();
sFilenameLocal = %>doEscape(<%=sFilenameLocal%>)<%;
System.out.println("FileName is: " + sFilenameLocal);
%>
I keep getting an "incompatible types" error even though the variable sFilenameLocal is a string variable.
I also tried putting quotes around the java sFilenameLocal variable with basically the same results.
What am I missing here? Any help will be appreciated. TIA