Provides an access to unuploaded files which have been rejected by extention filter or because an exception had been thrown during upload.
Namespace:
EasyAlgo.EAUploadAssembly: EasyAlgo.EAUpload (in EasyAlgo.EAUpload.dll)
Version: 1.3.0.0
Syntax
| C# |
|---|
public class RejectedFileCollection : NameObjectCollectionBase |
| Visual Basic (Declaration) |
|---|
Public Class RejectedFileCollection _ Inherits NameObjectCollectionBase |
Remarks
You cannot create an instance of this class with the new keyword.
EAUpload component creates object of this class automatically. You can obtain it by referencing the Upload..::.RejectedFiles property of an EasyAlgo.EAUpload..::.Upload object.
Examples
The following example demonstrates how to retrieve the RejectedFile object from RejectedFileCollection.
CopyC#
CopyVB.NET
// 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> ...
' 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> ...
Inheritance Hierarchy
System..::.Object
System.Collections.Specialized..::.NameObjectCollectionBase
EasyAlgo.EAUpload..::.RejectedFileCollection
System.Collections.Specialized..::.NameObjectCollectionBase
EasyAlgo.EAUpload..::.RejectedFileCollection
