메뉴 바로가기 검색 및 카테고리 바로가기

한빛미디어

뇌를 자극하는 ASP.NET 2.0 프로그래밍

뇌를 자극하는 ASP.NET 2.0 프로그래밍 질의응답 게시판입니다.

파일 업로드

2006-11-17

|

by

3624

열심히 공부 하고 있습니다.
그런데 웹에 대해서 초보라서 어려운 점이 많습니다.

다름이 아니라 26장 자료실에서
닷넷이 설치된 컴에서는 테스트를 잘 했습니다.
그런데
xp pro,닷넷프레임웍 2.0,iis 5.1, ms sql Express 만 설하고 소스를 올리니
다른것은 잘 작동하는것 같은데 파일 업로드가 안됩니다.

더 헤메이다가 질문을 올려야 하는데 그냥 함 봐주세요.

Server Error in / Application.
--------------------------------------------------------------------------------

Access to the path C:\Inetpub\wwwroot\File\a.txt is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path C:\Inetpub\wwwroot\File\a.txt is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:


Line 88:         else // 새로 업로드 할 파일과 동일한 이름을 가진 파일이 서버에 존재하지 않는다면.
Line 89:         {
Line 90:             fu.PostedFile.SaveAs(fFullName);
Line 91:
Line 92:             return fileName;


Source File: c:\Inetpub\wwwroot\App_Code\Pds.cs    Line: 90

Stack Trace:


[UnauthorizedAccessException: Access to the path C:\Inetpub\wwwroot\File\a.txt is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +2014691
   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) +998
   System.IO.FileStream..ctor(String path, FileMode mode) +65
   System.Web.HttpPostedFile.SaveAs(String filename) +87
   Pds.SaveFile(FileUpload fu, String upDir) in c:\Inetpub\wwwroot\App_Code\Pds.cs:90
   ASP.pds_write_aspx.ibOk_Click(Object sender, ImageClickEventArgs e) in c:\Inetpub\wwwroot\Pds_Write.aspx:11
   System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +105
   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
댓글 입력