Re: Exception: Cannot create a file when that file already exists.

  •  08-30-2010, 11:39 AM

    Re: Exception: Cannot create a file when that file already exists.

    Dear tien1504,
     
    <script runat="server">
    void Uploader_FileUploaded(object sender, UploaderEventArgs args)   
    {
        string path = "c:\\temp\\" + args.FileName;       
        //check whether same name file is existing
        if (System.IO.File.Exists(path))
        {
            //add your own code here, you can return directly, you can also change file name
        }       
        args.MoveTo(path);
    }
    </script>
     
    Thanks for asking
View Complete Thread