ASP .NET 2.0 Simple Tricks ( VI )
Simple file upload with one fileupload control and one button provided :
If FileUpload1.HasFile Then
FileUpload1.SaveAs _
(Server.MapPath(".") & _
"\" & FileUpload1.FileName)
Label2.Text = "File Size : " & _
Format(FileUpload1.PostedFile.ContentLength, _
"###,###,###.##") & " bytes"
Label2.Text &= "<br>File Content : " & _
FileUpload1.PostedFile.ContentType
End If