Live Support, Chat, Upload Control and Rich Text Editor
Welcome to Support forums Sign in | Join | Help |Client Center

Duplicates Uploaded files

  •  02-03-2009, 5:27 PM

    Duplicates Uploaded files

    Hi,

     I'm having a problem...I get duplicates upload when I do the following.

    First I upload  documents once they show on the grid..I upload another document. The problem is when I upload for the second time..it adds the original  documents that i've already added plus the new add file. Is there a solution to this? Here my code...
     
     
    <CuteWebUI:Uploader ID="Uploader2" runat="server" MultipleFilesUpload="true"
                                  
                                              onfileuploaded="Uploader2_FileUploaded" >
                                                                            <VALIDATEOPTION AllowedFileExtensions="jpeg, jpg" MaxSizeKB="102400" />
                                                                           
                                                                        </CuteWebUI:Uploader>


    here the event..

     protected void Uploader2_FileUploaded(object sender, UploaderEventArgs args)
        {
            GridView2.Dispose();
            string newname = "myfile." + args.FileGuid + "." + args.FileName + ".resx";
            Photo ph = new Photo();
            ph.PhotoGuid = args.FileGuid;
            ph.PhotoName = args.FileName;
            ph.PhotoTempName = newname;
            ph.AccidentID = 0;



            int exec = AccidentDAO.AddPhoto(ph);
        
            args.CopyTo(Path.Combine(Utils.GetFileDirectory2(), newname));


            GridView2.DataBind();
    }
     
    Thanks In Advance
    Jeff
     
     
     

    Filed under: ,
View Complete Thread
Powered by ASP.Net
Copyright 2003 - 2017 CuteSoft Components Inc.. All rights reserved.