Access to the path "....... is denied :AREA: asp.net 2005,C# ASp.net application at File Creation. RRS feed

  • Question




         I am working in an WEB Applictaion.with ASp.net 2005, C# and Win Xp.


         Here I have a the concept of Adding the Dynamically created Image to Display. but it showing the Error as ...


    //--------------List of the Exception Container Info ------------


    Ex. Error Message : Access to the path 'Application Path' is denied. 


    Ex.Source "mscorlib" 


    Ex.StackTrace  "   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n   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)\r\n   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)\r\n   at frmDisplayDocument.LoadComplaintDocument(String pstrComplaintNo) in e:\\PROJECTS\\KIC\\CODE\\frmDisplayDocument.aspx.cs:line 66"


    Ex.TargetSite {Void WinIOError(Int32, System.String)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}





    The Error I am getting at the point of "Image Creation in the server."







    Friday, November 30, 2007 6:54 AM


  • It means you have security issue when account under which application runs (ASPNET, Network Services or some other) does not have permissions to create files in specified folder. You would need to grant permissions in Windows if you are sure it is safe way to go. Other way to do all the tasks in a memory (if possible) to avoid storing files to disk, but you need to be carefull to cler all the memory resources.


    Friday, November 30, 2007 11:15 AM