When we are talking about uploading of file, we mean to say
upload file physically and save into a particular location in
server. We can also upload file that means save file into
database. Let us first examine how we can upload file physically
in a particular location in server. The code snippet has been
written in c#. In ASP.NET, we can do the file upload using HTML
Input (File) control (as shown in above figure: Figure1). In
order to start the process we need to follow the following basic
steps: Step I: Add the control: <input id="FileUpload"
type="file" runat="server"/> <form id="frmUpload"
enctype="multipart/form-data" runat="server"> - We may check
file type and allow user to upload some specific file only; - We
may allow user to upload upto a maximum size of file; - We may
check the length of file and disallow user to upload empty file
etc. How to check file type?
System.IO.Path.GetExtension(FileUpload.PostedFile.FileName);//It
will give the extension of file and thus help to identify file
type. if(Fil