Gets the UploadedFile object with the specified name from the file collection.

Namespace:  EasyAlgo.EAUpload
Assembly:  EasyAlgo.EAUpload (in EasyAlgo.EAUpload.dll)
Version: 1.3.2.0

Syntax

C#
public UploadedFile this[
	string fieldName
] { get; }
Visual Basic (Declaration)
Public ReadOnly Default Property Item ( _
	fieldName As String _
) As UploadedFile

Parameters

fieldName
Type: System..::.String
The value of "name" attribute of an INPUT element which the uploaded file is associated.

Field Value

Type: EasyAlgo.EAUpload..::.UploadedFile
The UploadedFile object. This property returns nullNothingnullptra null reference (Nothing in Visual Basic) if the specified key is not found.

Examples

The following example demonstrates how to retrieve the UploadedFile object by the form field name.
CopyC#
// fileupload.aspx.cs
...
Upload _CurrentUpload = UploadsManager.GetUpload();
UploadedFileCollection _UploadedFiles = _CurrentUpload.UploadedFiles;

// Get a UploadedFile object by form field name
UploadedFile _File = _UploadedFiles["File1"];

string _FileName = _File.ClientFileName;
...    
____________________________

// fileupload.aspx
...
<form id="Form1" method="post" runat="server">
...
    <input type="file" name="File1" id="File1">
...
</form>
...
CopyVB.NET
' fileupload.aspx.vb
...
Dim _CurrentUpload As Upload = UploadsManager.GetUpload
Dim _UploadedFiles As UploadedFileCollection = _CurrentUpload.UploadedFiles

'Get a UploadedFile object by form field name
Dim _File As UploadedFile = _UploadedFiles("File1")

Dim _FileName As String = _File.ClientFileName
...    
____________________________

' fileupload.aspx
...
<form id="Form1" method="post" runat="server">
...
    <input type="file" name="File1" id="File1">
...
</form>
...

See Also