Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Restart/Resume FTP DownloadResume downloading a file from an FTP server. LOCAL loFtp LOCAL lnSuccess LOCAL lcLocalFilename LOCAL lcRemoteFilename loFtp = CreateObject('Chilkat.Ftp2') * Any string unlocks the component for the 1st 30-days. lnSuccess = loFtp.UnlockComponent("Anything for 30-day trial") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loFtp.LastErrorText) QUIT ENDIF loFtp.Hostname = "ftp.chilkatsoft.com" loFtp.Username = "****" loFtp.Password = "****" * Connect and login to the FTP server. lnSuccess = loFtp.Connect() IF (lnSuccess <> 1) THEN =MESSAGEBOX(loFtp.LastErrorText) QUIT ENDIF * Change to the remote directory where the file is located. * This step is only necessary if the file is not in the root directory * for the FTP account. lnSuccess = loFtp.ChangeRemoteDir("temp") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loFtp.LastErrorText) QUIT ENDIF * To resume a download, it is assumed that the partial file * is already present on the local filesystem. * You only need to set the RestartNext property to resume * the download. The Chilkat FTP component sets the resume * point by getting the existing size of the target (local) file. loFtp.RestartNext = 1 lcLocalFilename = "big.zip" lcRemoteFilename = "big.zip" * Resume downloading... lnSuccess = loFtp.GetFile(lcRemoteFilename,lcLocalFilename) IF (lnSuccess <> 1) THEN =MESSAGEBOX(loFtp.LastErrorText) QUIT ENDIF loFtp.Disconnect() =MESSAGEBOX("File Downloaded!") |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2007 Chilkat Software, Inc. All Rights Reserved.
Mail Component · .NET Email Component · ASP Mail Component · XML Parser