2014-02-19 1 views
2

나는 webdav 서버에 파일을 업로드하려고하는데, (401) 권한이 없습니다. 내 문제는 서버 또는 내 코드 권한이 있는지 파악할 수 있습니까? 서버 구성의 WebDAV 제작 규칙 IIS 8을 실행하는webdav WebClient.Upload (401) Unconthorized

string webAddress = "http://ip:port/"; 
string sourceFilePath = webAddress + "testfile.txt"; 
string destinationFilePath = @"C:\testfile.txt"; 

WebClient webClient = new WebClient();    
webClient.UseDefaultCredentials = true; 
webClient.DownloadFile(sourceFilePath, destinationFilePath); 
webClient.Dispose(); 

:

string sourceFilePath = @"C:\testfile.txt"; 
string webAddress = "http://ip:port/"; 
string destinationFilePath = webAddress + "testfile.txt"; 

WebClient webClient = new WebClient(); 
webClient.UseDefaultCredentials = true; 
webClient.UploadFile(destinationFilePath, "PUT", sourceFilePath); 
webClient.Dispose(); 

그러나 내가 WebDAV 서버에서 파일을 다운로드 할 수 있습니다 다음 코드를 사용 :이이 테스트를 사용하여 코드 메신저입니다. 서버의 대상 폴더에서 내 사용자에 대한 모든 권한을 설정했습니다.

편집 : 파일을 다운로드 할 수있는 제작 규칙을 제거하더라도 왜 그런가요?

제작 규칙은 다음과 같습니다 문제를 해결

http://i61.tinypic.com/55rqkg.jpg

답변

0

설치 및 활성화 Windows 인증을. 이제는 그것이 가능해야한다는 논리가 있다고 생각합니다 ...