ASP Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

ASP Examples

ASP String
ASP Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar
ASP Upload
XML
XMP
Zip Compression

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
DH Key Exchange
DSA
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

Iterate Over Files in FTP Server Directory

Download 32-bit Chilkat FTP2 ActiveX (.msi)

Download All 32-bit Chilkat ActiveX Components (.zip)

Download All 64-bit Chilkat ActiveX Components (.zip)

Demonstrates how to use ListPattern to iterate over selected files in a remote FTP directory.

<HTML>
<HEAD>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=utf-8">
<TITLE>ASP FTP Directory</TITLE>
</HEAD>
<BODY>

<%
	' Create an FTP object
	set ftp = Server.CreateObject("Chilkat.Ftp2")

	' Any unlock code begins the 30-day trial
	ftp.UnlockComponent "anything"

	ftp.Username = "***"
	ftp.Password = "***"
	ftp.Hostname = "ftp.chilkatsoft.com"

	ftp.KeepSessionLog = 1
	
	ok = ftp.Connect()
	if (ok <> 1) then
		Response.Write ftp.LastErrorHtml
	else
		' List all ASP files in the FTP user account's home directory:
		ftp.ListPattern = "*.asp"
		
		' Get the number of files and directories matching the ListPattern
		' in the current remote directory.
		n = ftp.NumFilesAndDirs
		
		Response.Write "<b>ASP Files:</b><br>"
		for i = 0 to n-1
			' Call GetFilename(i) to get the Nth filename.
			' Call GetSize(i) to get the size in bytes
			Response.Write ftp.GetFilename(i) & ": " & ftp.GetSize(i) & " (bytes)<br>"
		next
		
		
		' Simply change the ListPattern to get other files...
		' List all XML files in the FTP user account's home directory:
		ftp.ListPattern = "*.xml"
		
		' Get the number of files and directories matching the ListPattern
		' in the current remote directory.
		n = ftp.NumFilesAndDirs
		
		Response.Write "<p><b>XML Files:</b><br>"
		for i = 0 to n-1
			' Call GetFilename(i) to get the Nth filename.
			' Call GetSize(i) to get the size in bytes
			Response.Write ftp.GetFilename(i) & ": " & ftp.GetSize(i) & " (bytes)<br>"
		next
		
	end if

	
	Set ftp = Nothing

%>

</BODY>
</HTML>
 

© 2000-2012 Chilkat Software, Inc. All Rights Reserved.