Hi, everybody.
i want to get file name from html file input form using jsp.
my codes are followed as:
<table>
<tr>
<td >
<input type="file" id="csvfilebrowse" name="csvfilebrowse" value="" width="400px" style="width:400px; height:20px" onChange="getcsvfilename();">
<script type="text/javascript">
// <![CDATA[
function getcsvfilename() {
var v_csvfileName = '';
v_csvfileName += document.getElementById('csvfilebrowse').value;
getCSVFileContents(v_csvfileName);
};
// ]]>
</script>
</td>
</tr>
<tr>
<td align="left">
<%
Workbook workbook = null;
Sheet sheet = null;
String csvFileName = v_csvfileName;
// Reading Test
workbook = Workbook.getWorkbook(new File(csvFileName));
sheet = workbook.getSheet(0);
for(int i=0;i<sheet.getColumns();i++){
Cell a1 = sheet.getCell(i,0);
String $stringa1 = a1.getContents();
}
%>
</td>
</tr>
</table>
here, what i want to get, how to convert the filename variable named v_csvfileName of javascript to the filename named csvFileName of jsp.
who can help me?
probably, there can be several method.
please kindly teach me.
thank you.