首页 > 代码库 > asp.net 上传

asp.net 上传

          if (FileUpload1.HasFile) 
        {
            string filenames = FileUpload1.PostedFile.FileName;
            string server_path = "images/";
            string ab_path = Server.MapPath(server_path);

            if (!Directory.Exists(ab_path)) 
            {
                Directory.CreateDirectory(ab_path);
            }

            if (File.Exists(ab_path + filenames)) 
            {
                
            }

            FileUpload1.SaveAs(ab_path + filenames);
        }

  

asp.net 上传