我在asp.net page.Here是代码图像上传到服务器..asp.net图片上传到服务器
代码:
protected void Button2_Click1(object sender, EventArgs e)
{
//resimyolu = "~/r/" + FileUpload1.FileName;
FileUpload1.SaveAs(Server.MapPath("~/r/a.png"));
FileUpload1.SaveAs("d:/upresim/a.png");
Image1.ImageUrl = "~/r/a.png";
}
的 'R' 的文件夹在我project.when图像文件夹我的图片添加到在运行时的“R”的文件夹,它的工作原理成功地在本地IIS,但是当我发表我的项目,其驻留在服务器(远程服务器)上的网页被打开在浏览器中,但是当我点击按钮2到客户端的图像(其中客户端用户从他的电脑中选择)添加到出现下一个错误的项目..
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
你的错误没有说太多。将您的customErrors模式设置为remoteOnly。然后,您可以从服务器运行此页面并查看正确的错误。 – nunespascal 2013-03-21 10:57:19
这里是正确的异常信息:System.Web.HttpException:SaveAs方法被配置为需要有根路径 – 2013-03-21 11:07:08
我买了你的时间,谢谢 – 2013-03-21 11:21:42