asp.net.ph

Skip Navigation LinksHome > ASP.NET Web Forms > Web Forms Server Controls > Controls You Can Use on Web Forms > ASP.NET HTML WebControls

ASP.NET HTML Controls

  Section Index


HtmlInputFile Server Control

Allows programmatic access to the HTML <input type=file> element on the server.

The HtmlInputFile control <input type=file ... runat="server"> handles uploading of binary or text files from a client browser to the server. File upload works with all HTML 3.2 and later Web clients.

<input type=file> creates a file upload object with a text box and browse button. This control allows users to select files, the contents of which are submitted with a form.

Users can enter a file path in the text box or click on the browse button to browse the file system. Authors may also specify an initial file name thru the control’s Value attribute.

The following sample illustrates using the HtmlInputFile control.

HtmlInputFile Control Example
Run Sample | View Source

Note that the Enctype attribute on the <form> tag must be set to multipart/form-data.

See Also

HtmlInputFile Control Syntax   FileUpload Web Server Control   HTML INPUT Element

More ...
Back to top


© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note