Does anyone know how to do FileUpload in asp.net 1.1. My current code works for 2.0 but I need to do this for 1.1. I know that FileUpload.HasFile doesn't work.Here is my code:
<%@ Page Language="vb" AutoEventWireup="false" Inherits="Promethius.PCMSPro.UploadFile" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<script runat="server">
Protected Sub cmdUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If Me.File1.PostedFile.ContentLength > "" Then
Me.File1.PostedFile.SaveAs(Server.MapPath("~/Upload/" & Me.File1.PostedFile.FileName))
Me.ltOne.Text = "File Uploaded Successfully"
End If
End Sub
</script>
<HTML>
<HEAD>
<TITLE>Upload File</TITLE>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</HEAD>
<body leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0">
<div id="global">
<form enctype="multipart/form-data" runat="server">
<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td id="TitleArea" class="dialogTitle">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="dialogTitle" bgcolor="#ecf0f4">
<img src="../images/icons/prom24.gif" align="left"><b><font face="Tahoma" color="#425971">Upload
File</font></b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="mainCell" height="100%" valign="top">
<font face="tahoma" size="1"> </font>
<div align="left" style="PADDING-LEFT:20px;PADDING-BOTTOM:20px;WIDTH:100%;PADDING-TOP:20px">
<asp:Label id="lblMessage" runat="server"></asp:Label><BR>
<BR>
Select file to upload:<BR>
<input id="File1" type="file" runat="server" NAME="File1" style="WIDTH: 328px; HEIGHT: 22px"
size="35">
<br>
<br>
File Location:
<asp:DropDownList ID="FileLoc" Runat="server"></asp:DropDownList>
</div>
<INPUT id="control" type="hidden" name="control" runat="server">
</td>
</tr>
<tr>
<td class="dialogButtons">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" bgcolor="#ecf0f4"> </td>
<td nowrap>
<asp:Button ID="cmdUpload" Runat="server" Text="Upload Document" OnClick="cmdUpload_Click"></asp:Button>
<input type="button" value="Done" class="Button" onclick="window.close();">
<br />
<asp:Literal ID="ltOne" runat="server" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
</body>
</HTML>