2014-06-18 2 views
0
에서 다운로드 파일을 업로드 할

안녕하세요 친구 중 하나는스크립트가 FTP

내가 당신에게 매우 감사 할 것입니다 당신에게 친구 감사 로그 보고서를 작성하기 위해 FTP에서하고 가능하면 & 다운로드 데이터를 업로드 나에게 스크립트를 도울 수 도움이 필요하면

+0

귀하의 은행 계좌로 금액을 이체 하시겠습니까? – Eliyahu

답변

0

이 다운로드는 http뿐만 아니라 ftp에서도 가능합니다. 최소한 http (ftp를 시도한 적은 없습니다)를 업로드 할 수 있으며, 문서를 참조하십시오. 업로드하려면 동사와 file.send uploaddata을 변경하십시오.

On Error Resume Next 
Set File = WScript.CreateObject("Microsoft.XMLHTTP") 
File.Open "GET", "http://www.pepperresources.org/LinkClick.aspx?fileticket=B1doLYYSaeY=&tabid=61", False 
'This is IE 8 headers 
File.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C; .NET4.0E; BCD2000; BCD2000)" 
File.Send 
If err.number <> 0 then 
    line ="" 
    Line = Line & vbcrlf & "" 
    Line = Line & vbcrlf & "Error getting file" 
    Line = Line & vbcrlf & "==================" 
    Line = Line & vbcrlf & "" 
    Line = Line & vbcrlf & "Error " & err.number & "(0x" & hex(err.number) & ") " & err.description 
    Line = Line & vbcrlf & "Source " & err.source 
    Line = Line & vbcrlf & "" 
    Line = Line & vbcrlf & "HTTP Error " & File.Status & " " & File.StatusText 
    Line = Line & vbcrlf & File.getAllResponseHeaders 
    wscript.echo Line 
    Err.clear 
    wscript.quit 
End If 

On Error Goto 0 

Set BS = CreateObject("ADODB.Stream") 
BS.type = 1 
BS.open 
BS.Write File.ResponseBody 
BS.SaveToFile "c:\users\test.txt", 2 
관련 문제