I have a .NET program to upload an image to a webserver. I am using the ASP.NET file uploading control to do it. The program works alright in my local environment but when I run it on the webserver, I get the following error:
> 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()
A quick Google search confirmed that it is a permissions issue; but since it only happens intermittently, I don't have a plan for diagnosing how to fix it.
My question is: What should I do to diagnose and fix this issue?