Re: ' character replaced with _x27_

  •  05-08-2010, 11:03 AM

    Re: ' character replaced with _x27_

    This symbol will cause some errors, we do not allow use it in file name. So we can add a warning to tell user do not use this symbol.   protected void
     
    Uploader1_FileUploaded(object sender, UploaderEventArgs args)
    {
          if (args.FileName.IndexOf("_x27_") > -1)
          {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "showerror", "<script>alert(' file name contains disable characters')</" +                  "script>");
                args.Delete();
          }
          else
          {  
                args.CopyTo("~/photo/" + args.FileName);
          }
    }
     
     
    Regards,
    Eric
View Complete Thread