Re: Multiple File Uploaded Problem

  •  02-13-2009, 9:21 AM

    Re: Multiple File Uploaded Problem

    Scott:
     
    Hi you may use this logic:
     
    void Uploader_FileUploaded(...)
    {
     
    int galleryid;
    object galleryidobj=ViewState["MyGalleryID"];
    if(galleryidobj==null)
    {
        galleryid=CreateNewGallery();
        ViewState["MyGalleryID"]=galleryid;
    }
    else
    {
        galleryid=(int)galleryidobj;
    }
     
    DoInsertFile(args,galleryid);

    }
     
    -----
     
    If you want to collect all files in the submit button event, I suggest you use the UploadAttachments control:
     
    void SubmitButton_Click(....)
    {
        int galleryid=CreateNewGallery();
        foreach(AttachmentItem item in new ArrayList(UploadAttachments1.Items))
        {
              if(!item.Checked)continue;
              DoInsertFile(galleryid,item);
              item.Delete();
        }
    }
     
    Regards,
    Terry
     
View Complete Thread