Answer by A Quora admin:
In order to upload a file using ASP. net, you need to follow the following steps.
1) In your .aspx page where you want to have your file upload functionality drag and drop the file upload control from the tool box.
2) Choose the event upon which you need to upload the file. In my example I have chosen to upload the file on a button click.
3) Now that I want my upload code need to be written in the Upload_Click event I go to the .aspx.cs page by double clicking on the Upload_Click action from the properties window and code as shown in the below screenshot.
4) For uploading the file to the server, replace the save Location path by the application server path where the user has access to. code to get the server path is Server.MapPath("Data") .
For further reading refer :
Hope it helps. Happy coding!