Answer:
First of all, we need a HTML server control to allow the user to select the file. This is nothing but the same old <input tag, with the type set to File, such as <input type=file id=”myFile” runat=server />. This will give you the textbox and a browse button. Once you have this, the user can select any file from their computer (or even from a network). Then, in the Server side, we need the following line to save the file to the Web Server.
myFile.PostedFile.SaveAs ("DestinationPath")
Note: The Form should have the following ENC Type
<form enctype="multipart/form-data" runat="server">
Asked In: Many Interviews |
Alert Moderator