【发布时间】:2008-12-22 07:14:34
【问题描述】:
我有一个 .NET 程序可以将图像上传到网络服务器。我正在使用 ASP.NET 文件上传控件来执行此操作。该程序在我的本地环境中运行正常,但是当我在网络服务器上运行它时,出现以下错误:
> System.UnauthorizedAccessException:
> Access to the path
> '\\fsvs02\target03\352972\352974\www.mysite.com\web\content\Images\TempStorage\tempImage.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 uploadimage.UploadImage()
快速谷歌搜索确认这是一个权限问题;但由于它只是间歇性发生,因此我没有计划来诊断如何修复它。
我的问题是:我应该如何诊断和解决这个问题?
【问题讨论】: