读书人

文件上传出错了,该如何解决

发布时间: 2012-01-02 22:40:04 作者: rapoo

文件上传出错了
小弟在本地做的啥事没有,但是传到网上错误就出来了
上传发生错误!原因是:System.UnauthorizedAccessException: Access to the path 'f:\usr\cn30120

\admin\daili\image\2007-08-22-10-40-11staujzv0j5it1pilx4tw5j4544.jpg ' is denied. at System.IO.__Error.WinIOError

(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access,

Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES

secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at

System.Web.HttpPostedFile.SaveAs(String filename) at admin_daili_insert.Button2_Click(Object sender, EventArgs e)

in f:\usr\cn30120\admin\daili\insert.aspx.cs:line 35


如果是权限的问题的话,请教大哥们怎么设置,我的空间是万网的

[解决办法]
将以下节添加到Web.Config中如下:
<system.web>
......
<identity impersonate= "true " userName= "yourComputerName\AdministratorAccount " password= "yourpassword " />
</system.web>
[解决办法]
up
[解决办法]
上传文件权限问题加一个这个就好了 <identity impersonate= "true "/>

读书人网 >asp.net

热点推荐