文件上传出错了
小弟在本地做的啥事没有,但是传到网上错误就出来了
上传发生错误!原因是:
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 "/>