System.Web Namespace HttpFileCollection Class
Gets an individual HttpPostedFile object from the file collection. This property is overloaded to allow retrieval of objects by either name or numerical index.
In [ C# ], this property is the indexer for the HttpFileCollection class.
1. Gets the object with the specified numerical index from the HttpFileCollection.
2. Gets the object with the specified name from the file collection.
The following example retrieves the file object named "CustInfo" from the collection sent by the client and retrieves the name of the actual file represented by the object.
NOTE: This example shows how to use one of the overloaded versions of the Item property ( HttpFileCollection indexer ). For other examples that might be available, see the individual overload topics.
HttpPostedFile myPostedMember = Request.Files [ "CustInfo" ];
String myFileName = myPostedMember.FileName;
Dim myPostedMember As HttpPostedFile = Request.Files ( "CustInfo" )
Dim myFileName As String = myPostedMember.FileName |
|
C# |
VB |
HttpFileCollection Members HttpPostedFile Class