My Name is Kay....

DIY , 먹방 , 개발 , 육아 , 여행 좋아합니다.
AdBlock 사용시 화면이 정상적으로 노출되지 않습니다.
포스팅 관련 문의 및 개발 문의는 Email : wkzkfmxksi@gmail.com

추가 포스팅이 이뤄지지 않는 블로그입니다. 문의는 wkzkfmxksi@gmail.com 으로 연락주세요.
kay
조회 수 5797 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

ASP 에서 사용가능한 FTP 컴포넌트


서버 간 특정 파일을 웹에서 동기화하기 위해 사용할 녀석을 찾던 중 알게된 녀석입니다.

90년에대 개발된 것이라고 하는데 여전히 많이 이용되고 있습니다..


원문 Url : http://www.codeguru.com/vb/vb_internet/article.php/c19511/Creating-an-FTP-Component-in-Visual-Basic.htm

Download : 981203AspFtp.zip


주의 : 클라이언트에서 서버로 사용하는 업로드 컴포넌트가 아닙니다..

서버 로컬에 있는 파일과 타 서버의 FTP 접속과 전송을 할수 있게 해주는 용도입니다.


비슷한 기능의 AspInet.zip 이라는 것도 있네요..( 이건 실제 사용해보지는 않았습니다만.. )


* 사용 가능한 기능 

폴더 생성 및 삭제 

폴더 리스트 가져오기

파일 송수신 및 삭제 

파일 리스트 가져오기

파일 읽어오기

파일명 변경

...

..


자세한 내용은 첨부 파일의 샘플을 확인해주세요.

 

aspftp.dll 파일 등록 하신 후 ..


<%@ LANGUAGE=VBScript %>
<!--#Include File="aspftp2.inc"-->
<%
'check to see if user submitted form
If Request.Form("PutIt") <> "" Then
	Dim objFTP
	Dim strMsg

	'create reference to object
	Set objFTP = Server.CreateObject("NIBLACK.ASPFTP")

	'set the properties for the connection
	objFTP.sServerName = "ftp.microsoft.com"
	objFTP.sUserID = "anonymous"
	objFTP.sPassword = "wally@wallyworld.com"
	
	'connect to the host
	If objFTP.bConnect Then	
		'set the properties for the put function
		objFTP.lTransferType = TRANSFER_TYPE_ASCII

		'now put the file
		If objFTP.bPutFile("c:\test.txt", "test.txt") Then
		    'put was successful
		    strMsg = "Put Successful!"
		Else
		    'put failed...let user know
		    strMsg = "Put Failed: " & objFTP.sError
		End If
	Else
		'connection failed...let user know
		strMsg = "Connection Failed: " & objFTP.sError	
	End If
	    
	'clean up...
	Set objFTP = Nothing
	
Else
	'default return msg
	strMsg = ""
End If
%>

<html>
<body> 
This example uses the Put method (bPutFile). All parameters
required for receiving a file are explicitly defined in the ASP code.<br>
<hr>
<br> 
<%If strMsg <> "" Then%>
Return Message: <%=strMsg%><br>
<hr>
<br>
<%End If%>

<form action="AspFTP2_Put.asp" method="post">
<input type="submit" name="PutIt" value="Put File">
</form>

</body>
</html>



?