System.Web.UI.HtmlControls Namespace HtmlInputFile Class
Sets or retrieves a comma-separated list of MIME encodings used to constrain the file types the user can select.
Inline |
<input type=file accept = strEncoding ... > |
Script |
HtmlInputFile.Accept [ = strEncoding ] |
strEncoding |
String specifying a comma-separated list of MIME type encodings. |
The property is read/write with no default value.
Use this property to specify the file types that can be uploaded to the server. For example, to restrict the selection to images, set this property to image/*.
NOTE: Support for this property is browser dependent, and may not work for all browsers.
The below code shows how to declaratively set the Accept property to restrict the user from selecting any file other than an image file.
<input type="file" id="myFileUploader" accept="image/*" runat="server"/>
Show me
HtmlInputFile Members