2014-05-21 110 views
0

以下是我的代碼,給定的路徑的格式不supported.SaveAs

   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); 

我收到提示說「給定的路徑的格式不supported'.What將成爲問題?

回答

0

首先什麼ü已記入 「FileUpload1」

和Y斜面ü嘗試這個

FileUploadPhoto.SaveAs(Server.MapPath("/UplodedImages/") + Path.GetFileName(FileUploadPhoto.FileName)); 
      ImageUpload.ImageUrl = "~/UplodedImages/" + Path.GetFileName(FileUploadPhoto.FileName); 
相關問題