|

Introduction
JustFTP is an ActiveX component (justftp.dll) that is used to access network resources using the
Internet FTP protocol.
JustFTP is
designed to be used in VBScript applications or ASP/ASP.NET Web
pages. See the sample code for file transfers etc. using ASP and
VBScript. It is ideal for scheduled file transfers written in
VBScript / JavaScript.
It can be easily "driven" by scripting languages such as
VBScript, JavaScript, ASP, ASP.NET. Also, because it exposes a COM IDispatch "Dual Interface", any modern language that supports COM
/ ActiveX can be used to "drive" the JustFTP component.
(Visual Basic or C/C++ for example.)
JustFTP
frees you from the networking details. It enables you to get on
with your file transfers and administrative tasks. Similar
components are often overly complex when, really, you just need
to 'get' or 'send' a known file.
However we also
understand that a remote directory listing can be quite useful
at times. Therefore we have included a basic "DIR" function that
your scripts or ASP pages can use to traverse the remote file
system. This functionality is left up to the user of JustFTP.
VBScript sample code to sort the directory results and look for
specific files is straightforward. We may include some of these
samples on our site as we get time.
Methods
The following 9 methods are
provided by the JustFTP component.
All methods return a simple string result (either "OK" or
"Fail").
The Dir method also returns a
directory listing of the remote server for the directory
specified. This is a string listing of files and directories
returned in the "DirList" variable that is passed to the
method. The returned directory listing shows
files prefixed by the two characters "F-",
directories prefixed by a "D-". This provides an easy way to
tell if a name returned is a sub-directory name or an actual file.
Get and
Send are binary (image) file transfer functions.
The GetASC and SendASC have been provided for use
where FTP ASCII file transfers are required (eg.
UNIX/Linux).
A major feature
of the JustFTP component is that there is no need to
maintain an FTP "session". Each method call sets up a session,
performs the required function, then closes the session
automatically, this makes administrative scripting of file
transfers easy and robust.
No testing for obscure error
codes is required. Just test for the string "OK" (or "Fail") to
control the flow of your script - see sample code below.
Methods provided:
| Dir(RemoteHost, RemoteDir, DirList, UserName, Password) |
| Get(LocalFile,
RemoteHost, RemoteDir, RemoteFilename,
UserName, Password) |
|
GetASC(LocalFile,
RemoteHost, RemoteDir, RemoteFilename,
UserName, Password ) |
|
MakeDir(RemoteHost,
RemoteDir, NewRemoteDir, UserName, Password) |
|
RemoveDir(RemoteHost,
RemoteDir, DirToDelete, UserName, Password) |
|
RemoveFile(RemoteHost,
RemoteDir, RemoteFilename, UserName, Password ) |
|
RenameFile(RemoteHost, RemoteDir,
RemoteExistingFilename, RemoteNewFilename, UserName, Password) |
|
Send( LocalFile,
RemoteHost, RemoteDir, RemoteFilename,
UserName, Password) |
|
SendASC(LocalFile,
RemoteHost, RemoteDir, RemoteFilename,
UserName, Password) |
These methods cater for most of
the common FTP file manipulation requirements. All methods
take username and password credentials, if these are not
required, an empty string ("") may be used.
Note: RemoveDir will
remove (delete) an empty remote Directory or folder
only. MakeDir
will make (create) a remote Directory or folder.
See
Code Examples
Download
the trial version 404 KB
|