通过托管我在使用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));
答案 0 :(得分:1)
在您的托管文件夹中,我会Set Up Access Permissions
,然后Plesk IIS Worker Process Identity Account (your account)
中的permissions Full Control make selected
答案 1 :(得分:0)
在Web.Config
中添加 <system.web>
<httpHandlers>
<add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/>
</httpHandlers>
<system.web>
答案 2 :(得分:0)
在将文件保存到文件夹
之前,请尝试检查目录是否存在if (!System.IO.Directory.Exists("folderpath"))
{
System.IO.Directory.CreateDirectory("folderpath");
}
答案 3 :(得分:0)
如果您的应用在集成模式池中运行,则必须在web.config文件中添加以下行:
<system.webServer>
<handlers>
<add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" />
</handlers>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>