multiple file upload in different location duplicates historial count

Nov 20, 2012 at 10:52 AM
Edited Nov 20, 2012 at 11:06 AM

hi

Im using your control which is working fine but i need some help. My problem is i want to share each uploaded file in two different locations for eg i select 3 images in file upload on postback i save them as

 private void managePost()
    {
        HttpPostedFileAJAX pf = FUA.PostedFile;
        if (pf != null)
        {
            if (FileContentUploadFilter().Contains(pf.ContentType, StringComparer.OrdinalIgnoreCase))
            {
                   FUA.SaveAs("AdminPics/" + pf.FileName);
                   FUA.SaveAs("UserPics/" + pf.FileName);
            }
            else
            {
                FUA.PostedFile.responseMessage_Uploaded_NotSaved = "Upload File type not Supported. List of supported extensions are: (1) doc / docx (2) xls / xlsx (3) txt (4) pdf (5) zip (6) tif (7) jpg ";
            }
        }

/////////////////

private void SaveGallery(){

if (FUA.historial != null)
            {
                for (int i = 0; i <= FUA.historial.Count - 1; i++)
                {
                    if (FUA.historial[i].Deleted == false && FUA.historial[i].Saved)
                    {
                     
                        gallery = Path.GetFileName(fupimage.FileName);
                        string filepath = MapPath("AdminPics/" + gallery);
                        string filepath2 = MapPath("UserPics/" + gallery);
                      //  save path to db logic
                    }
                }
            }

}

///////////////

Now when i save path and debug my application it has to give 3 fileupload.but instead its giving 6 files in historial.  How i save one file to two paths at the same time.