Gets the RejectedFile object with the specified index from the files collection.
Namespace:
EasyAlgo.EAUploadAssembly: EasyAlgo.EAUpload (in EasyAlgo.EAUpload.dll)
Version: 1.3.0.0
Syntax
| C# |
|---|
public RejectedFile this[ int index ] { get; } |
| Visual Basic (Declaration) |
|---|
Public ReadOnly Default Property Item ( _ index As Integer _ ) As RejectedFile |
Parameters
- index
- Type: System..::.Int32
The index of the RejectedFile object to be returned from the files collection.
Field Value
Type: EasyAlgo.EAUpload..::.RejectedFileThe RejectedFile object.
Examples
The following example demonstrates how to retrieve the RejectedFile object by the index.
CopyC#
CopyVB.NET
// fileupload.aspx.cs ... Upload _CurrentUpload = UploadsManager.GetUpload(); RejectedFileCollection _RejectedFiles = _CurrentUpload.RejectedFiles; if (_RejectedFiles.Count != 0) { RejectedFile _File = _RejectedFiles[0]; string _FileName = _File.ClientFileName; // displaying a warning lblResponse.Text = HttpUtility.HtmlEncode(_FileName) + " had been rejected. <br/>"; lblResponse.Text += "Only jpeg files is allowed for upload."; } ... ____________________________ // fileupload.aspx ... <form id="Form1" method="post" runat="server"> ... <input type="file" name="File1" id="File1"> <asp:Label id="lblResponse" runat="server"></asp:Label> ... </form> ...
// fileupload.aspx.vb ... Dim _CurrentUpload As Upload = UploadsManager.GetUpload Dim _RejectedFiles As RejectedFileCollection = _CurrentUpload.RejectedFiles If _RejectedFiles.Count <> 0 Then Dim _File As RejectedFile = _RejectedFiles(0) Dim _FileName As String = _File.ClientFileName 'displaying a warning lblResponse.Text = HttpUtility.HtmlEncode(_FileName) & " had been rejected. <br/>" lblResponse.Text &= "Only jpeg files is allowed for upload." End If ... ____________________________ ' fileupload.aspx ... <form id="Form1" method="post" runat="server"> ... <input type="file" name="File1" id="File1"> <asp:Label id="lblResponse" runat="server"></asp:Label> ... </form> ...
Exceptions
| Exception | Condition |
|---|---|
| System..::.ArgumentOutOfRangeException | index is outside the valid range of indexes for the collection. |
