input 上传文件

 

            if (this.Accessory.Value != null && !this.Accessory.Value.Equals(""))
            {
                try
                {
                    AccessoryName = this.Accessory.PostedFile.FileName;

                    this.Accessory.PostedFile.SaveAs(Server.MapPath("~/upload/accessory/") + AccessoryName);
                  
                }
                catch (Exception ex)
                {
                    Universal.ExceptionLog(Request.RawUrl, ex.ToString());
                    base.AddError("附件上传失败!");
                    if (AccessoryName != "")
                    {
                        System.IO.File.Delete(System.Configuration.ConfigurationManager.AppSettings["LocalLogicPath"] + System.Configuration.ConfigurationManager.AppSettings["UploadAccessoryPath"] + AccessoryName);
                    }
                    AccessoryName = "";
                }
            }

你可能感兴趣的:(input 上传文件)