0

我正在用 asp.net 开发 WebSiteProject。Server.MapPath方法不起作用,但上传数据时我没有收到错误

我正在检查指定的文件夹,但它是空的。

我的代码:

fupCategory.SaveAs(Server.MapPath("~/Assets/Upload/Category/" 
                   + fupCategory.FileName));
4

1 回答 1

0

You're using both the SaveAs and MapPath methods correctly, it might be a problem with permissions...

Try debugging that line and see that you don't get thrown out of the method. If you're sure there is no exception thrown check the server logs...

Another option - you might be missing some of the folders in that path, but that too should raise an exception...

于 2013-02-05T11:55:48.740 回答