2010-01-22 2 views
1

외부 파일과 관련이있을 수 있지만 오류 Path not found이 발생하고 그 이유를 모르겠습니다. 아래 코드.VBScript의 CopyFile이 작동하지 않습니다.

<% 

Dim fs 
set fs = Server.CreateObject("Scripting.FileSystemObject") 
fs.CopyFile "http://domain.com/file.xml","softvoyage.xml" 
set fs = Nothing 

%>DONE. 

답변

3

FileSystemObject는 로컬 디스크 파일에만 사용됩니다. 이 시도 :

<% 
    url = "http://www.espn.com/main.html" 
    set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") 
    xmlhttp.open "GET", url, false 
    xmlhttp.send "" 
    Response.write xmlhttp.responseText 
    set xmlhttp = nothing 
%> 

http://classicasp.aspfaq.com/general/how-do-i-read-the-contents-of-a-remote-web-page.html

+1

"로컬 디스크 파일"또는 UNC 파일 공유를 통해 사용할 수있는 파일 – AnthonyWJones

+0

@Anthony : 네, 고마워요. – egrunin

1

에서 찾을 나는 CopyFile 수 방법은 HTTP 소스에서 파일을 복사 할 수 있다고 생각하지 않습니다. 내가 source 매개 변수에 대한 본 적이 유일한 예는 로컬 파일 시스템에서 파일을 다음과 같습니다

FileSystemObject.CopyFile "c:\srcFolder\srcFile.txt", "c:\destFolder\" 

당신이 HTTP 요청에서 데이터를 저장 IXMLHTTPRequest object을 확인해야합니다.

관련 문제