0

以下是我的代码,

              string path1 = string.Format("{0}/{1}", Server.MapPath("~/Content/UploadedFolder"), Request.Files
                   ["FileUpload1"].FileName);
                if (System.IO.File.Exists(path1))
                System.IO.File.Delete(path1);

               Request.Files["FileUpload1"].SaveAs(path1);

我收到错误消息“不支持给定路径的格式”。会出现什么问题?

4

1 回答 1

0

首先你传递给“FileUpload1”的内容

你不能试试这个

 FileUploadPhoto.SaveAs(Server.MapPath("/UplodedImages/") + Path.GetFileName(FileUploadPhoto.FileName));
            ImageUpload.ImageUrl = "~/UplodedImages/" + Path.GetFileName(FileUploadPhoto.FileName);
于 2014-05-21T10:51:49.880 回答