【.Net码农】关于使用FileUpload控件报 Could not find a part of the path "X/1.jpg"
来源:互联网 发布:ami js 编辑:程序博客网 时间:2024/05/22 06:06
http://blog.csdn.net/jinho/article/details/5191756
最近做项目在本地上传图片成功!但是发布到IIS里面上传就报 "Could not find a part of the path //ip/filepath "; 这个真的是把我郁闷惨了,甚至还怀疑过FileUpload控件,现在想想真的是好笑!最后终于Google到了答案。原因是由于文件夹的权限问题!缺省情况下,ASP.NET应用程序以本机的ASPNET帐号运行,该帐号属于普通用户组,权限受到一定的限制,以保障ASP.NET应用程序运行的安全。但是有时需要某个ASP.NET应用程序或者程序中的某段代码执行需要特定权限的操作,比如某个文件的存取,这时就需要给该程序或相应的某段代码赋予某个帐号的权限以执行该操作
如果你要把图片上传到 images 文件夹下面, 则右键该文件夹--》属性--》安全--》Edit--》Add--》输入"Everyone" .点击OK即可!
PS:
在使用FileStream流读取文件的时候,文件必须是本地文件!不能读取虚拟的目录!我之前做sharepoint项目的时候,上传到sharepoint中Mysite的share picture 文件件里面,由于没有使用FileUpload的saveAs方法,一直出现“Could not find a part of the path //ip/filepath ”异常!郁闷了我好久![要首先保存到本地,在读取字节流上传!]
0 0
- 【.Net码农】关于使用FileUpload控件报 Could not find a part of the path "X/1.jpg"
- .net中创建目录的问题(未找到路径X的一部分|Could not find a part of the path)
- 关于错误提示:could not find a part of path “X:\”的解决办法
- DirectoryNotFoundException: Could not find a part of the path "……"
- gitlab 安装报错:Could not find modernizr-2.6.2 in any of the sources
- RESTEASY报错Could not find resource for full path
- Git of [error]could not find git path
- Could not find a price list in Ordered UOM xxx and Primary UOM of the item
- The document "X.xib" could not be opened. Could not read archive. Please use a newer version of Xco
- 安装j2ee 报错 Could not find the required version of the Java(TM)2 Runtime Environment in '(null)'
- 安装J2EE的SDK报错:could not find the required version of the Java(TM)2 Runtime Environment i
- J2EE SDK安装报错could not find the required version of the Java(TM)2 Runtime Environment in '(null)'
- Eclipse报错:this compilation unit is not on the build path of a java project
- 启动Tomcat报错:Could not find the main class
- IAR报错could not find the following source file
- hibernate 报错:Could not find a getter for ~
- rails3.2 报Could not find a JavaScript runtime错误
- net core生成数据库,使用Scaffold-DbContext报错“‘Scaffold-DbContext’ is not recognized as the name of a cmdlet”
- 19-集合框架工具类-17-常用对象API(集合框架-工具类-Arrays-方法介绍)
- 更新
- hdu4763
- 我的微信订阅号开发--新手篇
- 在VS2013中 用opencv循环读取文件夹下的文件
- 【.Net码农】关于使用FileUpload控件报 Could not find a part of the path "X/1.jpg"
- JDK环境变量配置方法详解
- POJ 2039:To and Fro
- 根据日期,转换成星座、生肖工具类
- 搭建Java Web项目 Maven管理jar包
- UIWebView加载本地HTML5文件
- HDU2193-AVL-数据结构-AVL
- 【小熊刷题】valid number - 各种edge cases真是醉了
- 语义分析的一些方法(一)