hYph3n
05-23-2006, 06:55 AM
I want to get the filename of the file that is being selected to be upload.
I have used the following code as the HTML form
<form action="uploadInvoicelogo.jsp?mode=cus_part_userdefinedfields&tab=0&action=upload" ENCTYPE="multipart/form-data" method="post" name=upload>
<table width="602" border="0" cellspacing="0" cellpadding="5" class="lightTable">
<tr>
<th colspan="2" nowrap>Uplaod Gif file for Logo:</th>
</tr>
<%
if(!flag){
%>
<tr>
<td colspan="2" align="center" nowrap><font color="red">Only gif, jpg, png images required for logo</font></td>
</tr>
<%
}
%>
<tr>
<td nowrap width="179">Enter Logo file (Gif only):</td>
<td><input type="file" class="formText" name="userDefinedField1" value="" size="31" ></td>
</tr>
<tr>
<td nowrap colspan="2" align="center">
<button name="B1" class="formButtonWide" onclick="return uploadLogo();">Upload</button></td>
</tr>
</table>
</form>
The file is being transfered to the server using the JSP. In which I am able in using this code and saving the file to a "Hardcoded" name ... but when i try to get the name of the file (by any means ... even i have tried to save the name in hidden field) i always get a null value ... :(
can any one help?
I have used the following code as the HTML form
<form action="uploadInvoicelogo.jsp?mode=cus_part_userdefinedfields&tab=0&action=upload" ENCTYPE="multipart/form-data" method="post" name=upload>
<table width="602" border="0" cellspacing="0" cellpadding="5" class="lightTable">
<tr>
<th colspan="2" nowrap>Uplaod Gif file for Logo:</th>
</tr>
<%
if(!flag){
%>
<tr>
<td colspan="2" align="center" nowrap><font color="red">Only gif, jpg, png images required for logo</font></td>
</tr>
<%
}
%>
<tr>
<td nowrap width="179">Enter Logo file (Gif only):</td>
<td><input type="file" class="formText" name="userDefinedField1" value="" size="31" ></td>
</tr>
<tr>
<td nowrap colspan="2" align="center">
<button name="B1" class="formButtonWide" onclick="return uploadLogo();">Upload</button></td>
</tr>
</table>
</form>
The file is being transfered to the server using the JSP. In which I am able in using this code and saving the file to a "Hardcoded" name ... but when i try to get the name of the file (by any means ... even i have tried to save the name in hidden field) i always get a null value ... :(
can any one help?