通過舉辦我給錯誤得到一個錯誤。AjaxFileupload只有在共享主機
"*System.IO.DirectoryNotFoundException: Could not find part of the path "C: \ Windows \ TEMP \ _AjaxFileUpload \ F0815340-BAEA-E056-B62F-F33770BBEDF4*"."
代碼:
string filePath = "~/folder/"+e.filename;
AjaxFileUpload1.SaveAs(MapPath(filePath));
我認爲你必須改變asp.net用來臨時存儲上傳的默認temp directroy。通常在共享主機上,您無權訪問c:\ windows \ temp文件夾。嘗試:http://blogs.msdn.com/b/viag/archive/2006/10/25/how-to-change-the-default-tempfile-upload-location-for-the-asp-net-2- 0-文件上傳-control.aspx – user2453734
<彙編調試= 「假」 targetFramework = 「4.0」 tempDirectory = 「C:/用戶/ LocalUser /../../溫度/」> – user3384879
但再次錯誤 – user3384879