Gets the collection of rejected files.

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

Syntax

C#
public RejectedFileCollection RejectedFiles { get; }
Visual Basic (Declaration)
Public ReadOnly Property RejectedFiles As RejectedFileCollection

Field Value

Type: EasyAlgo.EAUpload..::.RejectedFileCollection
The instance of a RejectedFileCollection class that is associated with Upload object and contains collection of rejected files.

Remarks

The EasyAlgo.EAUpload..::.RejectedFileCollection contains the files which have been rejected by the file extentions filter. For more information see UploadEnvironment..::.AllowedFileExtentions and "AllowedFileExtentions" parameter of EAUpload configuration.

Examples

The following example demonstrates how to retrieve the RejectedFile object from RejectedFileCollection.
CopyC#
// fileupload.aspx.cs
...
Upload _CurrentUpload = UploadsManager.GetUpload();
RejectedFileCollection _RejectedFiles = _CurrentUpload.RejectedFiles;

if (_RejectedFiles.Count != 0)
{
    RejectedFile _File = _RejectedFiles["File1"];
    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>
...
CopyVB.NET
// 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("File1")        
    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">
...
</form>
...

See Also