我正在從kendo上傳控件中移除圖像。system.io.file.exists無法在mvc4中工作
這是我的代碼
public ActionResult Remove(string[] fileNames)
{
if (fileNames != null)
{
foreach (var fullName in fileNames)
{
var fileName = Path.GetFileName(fullName);
var physicalPath = Server.MapPath(Path.Combine(("~/AssetAttachments"),fileName));
if (System.IO.File.Exists(physicalPath))
{
System.IO.File.Delete(physicalPath);
}
}
}
return Content("");
}
Physicalpath我已經是E:\ KARTHIK相關\ JPL \開發的\ src \ AssetTrackingSystem \ AssetTrackingSystem \ AssetAttachments \ Attach3.jpg
即使文件和可用目錄
if (System.IO.File.Exists(physicalPath))
正在返回錯誤並出現條件。
您的幫助將不勝感激。
什麼是'physicalPath'的價值? –