System.Web.UI.HtmlControls Namespace HtmlInputFile Class
Provides access to the uploaded file specified by a client.
Script |
HtmlInputFile.PostedFile. [ propertyname | methodName ] |
This property can only be used programmatically; it cannot be set when declaring the control.
A System.Web.HttpPostedFile object that represents the file to be uploaded.
Browser security restrictions prevent this value from being maintained across multiple requests.
The below code shows a simple way to use the PostedFile property to check if the user has uploaded a file.
if ( myFileUploader.PostedFile != null ) {
... get its properties, save the file, do whatever here
}
If Not ( myFileUploader.PostedFile Is Nothing ) Then
... get its properties, save the file, do whatever here
End If |
|
C# |
VB |
HtmlInputFile Members HttpPostedFile