The info you requested

From: R Reyes (RReyes_at_discussions.microsoft.com)
Date: 09/15/04


Date: Wed, 15 Sep 2004 13:53:07 -0700

Here is the error:
System.UnauthorizedAccessException: Access to the path
"C:\public\tempFiles\work\docs\testing.doc" is denied. at
System.IO.__Error.WinIOError(Int32 errorCode, String str) at
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean
bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode,
FileAccess access, FileShare share) at System.IO.File.OpenRead(String path)
at myProj.ForumSubmit.uploadFile(String strAttachFile) in
c:\inetpub\wwwroot\myProj\forumsubmit.aspx.cs:line 166

The folder permissions in my computer are set for read/write access. This
is a server-side c# project and currently resides on my machine. I am using
a IIS5, VS.NET, and a free web hosting service that lets me serve the website
on my computer while being able to access it from the outside (though i do
not believe this matters; all the correct ports are opened anyhow).

Right now, I am trying to upload a file from one folder in my computer to a
folder on a web server my friend set up and they have read/write granted
also. Eventually this project will be run from any client computer and will
upload a file from their computer to wherever the web server is. The context
is that this is used for attaching a file to a forum message (for viewing).

I hope I've answered your questions. If you need any more info, I will get
back to you. Thanks for your help.
 



Relevant Pages

  • Re: UnauthorizedAccessException: Cant write to file, but I can read i
    ... > FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean ... > bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, ... > FileAccess access, FileShare share) at System.Xml.XmlDocument.Save(String ...
    (microsoft.public.dotnet.framework.aspnet)
  • Error accessing Documents and Settingsdefault.vol file ?
    ... at System.IO.__Error.WinIOError(Int32 errorCode, String str) at ... System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, ... FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath) at ...
    (microsoft.public.dotnet.framework.compactframework)
  • WS Development Kit (Technology Preview) Problem
    ... at System.IO.FileStream..ctor(String path, FileMode mode, ... FileAccess access, FileShare share, Int32 bufferSize, Boolean ... useAsync, String msgPath, Boolean bFromProxy) ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Unknown error in XmlSerializer
    ... String ... at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) ...
    (microsoft.public.dotnet.xml)
  • Re: File IO Error!!!
    ... > at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess ... > access, FileShare share, Int32 bufferSize, Boolean useAsync, String ...
    (microsoft.public.dotnet.languages.csharp)