ASP.Net has two controls that allow the users to upload files to the web
server. Once the server receives the posted file data, the application can save
it, check it or ignore it. The following controls allow the file uploading:
Both the controls allow file uploading, but the FileUpload control
automatically sets the encoding of the form, whereas the HtmlInputFile does not
do so.
The FileUpload class is derived from the WebControl class, and inherits all its members. Apart from those, the FileUpload class has the following read-only properties:
·
HtmlInputFile - an HTML server control
·
FileUpload - and ASP.Net web control
The FileUpload class is derived from the WebControl class, and inherits all its members. Apart from those, the FileUpload class has the following read-only properties:
The posted file is encapsulated in
an object of type HttpPostedFile, which could be accessed through the
PostedFile property of the FileUpload class.
Example:
0 comments:
Post a Comment