You might already know why I love asp.net and why my website is programmed with the .net language, its because its so easy and simple, everything is made for you, you sometimes you might be limited in functions, but then you can make your own and let in inherit functionality else where.
This time you will se how easy it is to upload a file to your server, this is a must have function on every website with has an administrator back-end, cms system etc.
The smart thing about fileupload is that you dont have to connect to a server or anything, cause this will be done as you are already on the server when you are on the website, if you know what I mean.
One more thing, you will need the file upload control, it can be added like this.
<asp:FileUpload ID="FileUpload1" runat="server" />
Well here is the file upload code.
If FileUpload1.HasFile Then
FileUpload1.SaveAs(Server.MapPath("The_Name_Of_The_File"))
End If
As you can see its so simple, you just use saveAs then call the server.mappath which calls the current folder on the webserver and lets you give the file a new name to save it.
That is what I call easy coding.