Attention: We are retiring the ASP.NET Community Blogs. Learn more >

File upload control in ASP.NET 2.0

Ok, I was sitting infront of the computer screen and was thinking what to write so i decide to give you a clue how to use file upload control. Enough talking time for coding :)

- In our aspx file

<asp:FileUpload ID="FileUpload1" runat="server />

<asp:Button ID="Button1" runat="server Text="Upload File" />

- In our code behind aspx.vb file (by the way I am using VB)

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

FileUpload1.SaveAs("C:\") ' if you point to a server path don't forget to set write permission for internet guest account

End Sub

So thats it if you have future questions please ask

No Comments