UploadAttachmentFile Items Count doesnt't work?

Last post 04-16-2009, 11:10 AM by cutechat. 4 replies.
Sort Posts: Previous Next
  •  04-15-2009, 11:56 AM 51114

    UploadAttachmentFile Items Count doesnt't work?

    Hi,
    I'm evaluating the trial version of your (fantastic!) Ajax Uploader, in ortder to purchase it, and reading into this forum I have learned a lot of things.
     
    But now, I have a problem:
     
    I have inserted into my web page the "Upload Attacments" control in order to manipulate all the files uploaded; in the "FileUploaded" event I would like to read all the FileName in the AttachmentItems, so I iterate in this manner:
     
    For Each myUploadedFile As AttachmentItem In UploadAttachmentFile.Items

    lblmyLabel.Text &= myFile.FileName & "; "

    Next

    The problem is that the it gives me all the uploaded file less the last one! For example, if I choose 4 files to upload in the Items colelction I have only 3 elements.
     
    To verify this, I have tried in this way, but It is the same:
     
    For contFile As Integer = 0 To UploadAttachmentFile.Items.Count - 1

    lblmyLabel.Text &= UploadAttachmentFile.Items(contFile).FileName & "; "

    Next

    If I try to upload 4 files the Items.Count is = 3 ...
     
    Could you help me please?
     
    THANK YOU VERY MUCH.
    Igor
     
     
     
     
     
  •  04-15-2009, 2:53 PM 51127 in reply to 51114

    Re: UploadAttachmentFile Items Count doesnt't work?

    Try change

    Each myUploadedFile As AttachmentItem In UploadAttachmentFile.Items
     
    to:
     
    Each myUploadedFile As AttachmentItem In UploadAttachmentFile.Items.ToArray()
     
    keep me posted

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  04-15-2009, 3:50 PM 51134 in reply to 51127

    Re: UploadAttachmentFile Items Count doesnt't work?

    Thank you for your answer,
    I have tried to insert ".ToArray()" but IT DOESEN'T WORK...
     
    sorry!
     
    Any other idea?
  •  04-16-2009, 3:23 AM 51147 in reply to 51134

    Re: UploadAttachmentFile Items Count doesnt't work?

    I've understood where was the problem: the FileUpload event occur for EVERY selected file (in multiselection mode), so it is not necessary iterate in this event for all the uploaded file!
     
    Thanks a lot for your help.
    Best regards.
    Igor
     
     
  •  04-16-2009, 11:10 AM 51163 in reply to 51147

    Re: UploadAttachmentFile Items Count doesnt't work?

    Igor,
     
    Yes.
     
    You can process all items at the PreRender event.
     
    Regards,
    Terry
     
View as RSS news feed in XML