ajax方法中MapPath()方法不能使用,
如
MapPath("FileExchanged/" + System.IO.Path.GetFileName(InFile.PostedFile.FileName));
替换方法是使用
HttpContext.Current.Request.PhysicalApplicationPath+("FileExchanged\\" + System.IO.Path.GetFileName(fileName)) 来替换。
另:<input type="file" id="" runat="server"/> 不能与微软的ajax一块使用
本文介绍了在Ajax方法中无法使用MapPath()方法的问题及解决方案,推荐使用HttpContext.Current.Request.PhysicalApplicationPath结合文件名的方式进行替代,并指出<input type="file">元素与微软Ajax不兼容。
190

被折叠的 条评论
为什么被折叠?



