ASP.NET Uploading files in ASP.NET
<html>
<head><span style="color: #0000ff;">
<script language="VB" runat="server">
Sub Button1_Click(sender As Object, e As EventArgs)
if FileUpLoad1.HasFile
'Uncomment this line to Save the uploaded file
'FileUpLoad1.SaveAs("C:\SomePhysicalPath" &
FileUpLoad1.Filename)
Label1.Text = "Received " & FileUpLoad1.FileName & "
Content Type " & FileUpLoad1.PostedFile.ContentType & " Length " &
FileUpLoad1.PostedFile.ContentLength
else
Label1.Text = "No uploaded file"
end if
end sub
</script></span>
</head>
<body>
<h3><font face="Verdana">File Upload</font></h3>
<span style="color: #008000;"><form runat=server>
<asp:FileUpLoad id="FileUpLoad1" AlternateText="You cannot
upload files" runat="server" />
<asp:Button id="Button1" Text="Upload" OnClick="Button1_Click"
runat="server" />
<asp:Label id="Label1" runat="server" />
</form></span>
</body>
</html>
You can
leave a response, or
trackback from your own site.
Leave a Reply
You must be logged in to post a comment.