본문 바로가기

쓸만한 주저리

c#에서 파일 업로드 후 삭제가 안될 때

반응형

보통 "파일은 다른 프로세스 에서 사용 중이므로 프로세스 에서 액세스 할 수 없습니다" 오류를 만나게 된다.

도대체 왜 이러나...

가끔은 기다려 보면 해제되기도 해서 그려러니 하고 있다가

오늘은 10여분을 기다려도 해제가 안되어서 찾아 보니...


http://stackoverflow.com/questions/6750033/file-is-locked-after-httppostedfile-saveaslocationonserver


I have dealt with the same situation in the past. You need to run your application pool under a domain account. That is, the app pool under which your web application is running should be setup to run as a domain user. That same domain user should then be given permissions to the folder you are trying to upload to. In order to assign a domain user to your application pool, select the appropriate pool from the application pools node in IIS, right click and select properties. From the properties dialog box select the identity tab and choose "Configurable" and then provide a domain account. Then you should give permissions to the same user on your folder.


대충 번역해 보면...

도메인이 있는 상태에서는 정상 작동한다는 내용이다.

아마 현재 내가 로컬에서 시험삼아 작동시켜 보는 중이라서 안되는 것 같다.

실서버에 올리고 시험해 봐야겠다.


실서버에서는 잘 작동한다. ㅋ

반응형