Duplicates Uploaded files

  •  02-03-2009, 5:27 PM

    Duplicates Uploaded files


     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" />

    here the event..

     protected void Uploader2_FileUploaded(object sender, UploaderEventArgs args)
            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));

    Thanks In Advance

    Filed under: ,
View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems