我在页面放了一个input导入文件控件,并把指定的图片保存到SQL SERVER数据库中;
但出现了下面的问题,请大家帮一忙,谢谢!
---------------------------
未能找到文件“C:\Documents and Settings\All Users\Documents\My Pictures\示例图片\Winter.jpg”。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.IO.FileNotFoundException: 未能找到文件“C:\Documents and Settings\All Users\Documents\My Pictures\示例图片\Winter.jpg”。源错误:
行 183: {
行 184: int_PicterMark = 1;
行 185: fs = new FileStream(this.File_Picter.Value.ToString().Trim(), FileMode.Open);
行 186: }
行 187: else
------------------------------
但出现了下面的问题,请大家帮一忙,谢谢!
---------------------------
未能找到文件“C:\Documents and Settings\All Users\Documents\My Pictures\示例图片\Winter.jpg”。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.IO.FileNotFoundException: 未能找到文件“C:\Documents and Settings\All Users\Documents\My Pictures\示例图片\Winter.jpg”。源错误:
行 183: {
行 184: int_PicterMark = 1;
行 185: fs = new FileStream(this.File_Picter.Value.ToString().Trim(), FileMode.Open);
行 186: }
行 187: else
------------------------------
请参考
http://www.gzopen.com.cn/InfoView/Article_1884.html
好象不是权限的问题,我在自己的电脑上调试是成功的,但到其他电脑上浏览(使用)就出现这样的问题(System.IO.FileNotFoundException: 未能找到文件).文件实际上是存在的
new FileStream(this.File_Picter.Value.ToString().Trim(), FileMode.Open); 打开的是服务器本地的文件,你的服务器上不存在这个文件,当然会报错。