How to "Upload file in a webpage" in asp.net

• HTML server control
<input type=file id="myFile" runat=server />.


• server side, it is available as.

myFile.PostedFile.SaveAs ("DestinationPath")

• Form should have the following ENC Type
<form enctype="multipart/form-data" runat="server">



setting particular filetypes like *.txt is not allowed.
On failure, if page posts back -- user may have to reenter the data. Plan for workarounds.