Skip to main content

FTPeek

Table of Contents:


FTPeek

The 360Works FTPeek plugin enables SFTP (encrypted with SSH) / FTP / FTPS (encrypted with SSL) functionality in FileMaker, including:

  • Establish an FTP connection to a server
  • View a list of files in a specified directory
  • Download files from the server to a specified directory
  • Optionally rename the local file upon download

You can select what type of FTP protocol you want to use by using one of the FTPeek_Connect methods. For regular unencrypted FTP, use FTPeek_ConnectFTP. You can also do SFTP with FTPeek_ConnectSFTP or FTPS with FTPeek_ConnectFTPS.

Once you're connected, the plugin functions to upload, download, etc. are the same for all three protocols.

More information about the FTP protocol, as well as the secure variations (SFTP and FTPS) can be found at this Wikipedia article.

User Guide

See the 360Works FTPeek User Guide for a comprehensive list of all functions, their parameters, and their usage.

Note:

Nearly all documentation for 360Works FTPeek is contained in the User Guide, unlike some other products.

To Demo and Purchase

See the 360Works FTPeek page to download a demo of 360Works FTPeek, view pricing, or purchase it.

Example Usage

This shows an example of connecting to a secure SFTP server, getting a list of files, and downloading one of them.

Step #1: Get public key of the server. This returns text that can be stored in FileMaker.

Set Field[ example::publicKey; FTPeek_GetPublicKey( "host.address.com" ) ]
If[ example::publicKey = "ERROR" ] ...show error using FTPeek_LastError...

Step #2: Connect to the server. Requires public key and client authentication.

 if[ FTPeek_ConnectSFTP( "host.address.com" ; example::publicKey ; "username";
"password" ) = "ERROR" ] ...Handle error...

Step #3: Get a list of files in a directory on the server

 Set Field[ example::filesList; FTPeek_GetFileList( "/Users/username/" ) ]
if[ example::filesList = "ERROR" ] ...show error using FTPeek_LastError...

Step #4: Download the first file in the list to a temp directory and name it newFileName.

 If[ FTPeek_DownloadFile( "/tmp/" ; GetValue( example::filesList; 1 );
"newFileName" ) = "ERROR" ] ...Handle error...

Step #5: Disconnect

 If[ FTPeek_Disconnect = "ERROR" ]
...Display error message to user, but we don't need to do anything else...

Relative vs. Absolute Paths

All functions support referencing remote files and directories as relative or absolute paths. A relative path references files and directories starting from the current working directory. For example, if we are in the /uploaded/FTPeek/ directory on the remote server, changing into backup would navigate into the /uploaded/FTPeek/backup/ directory.

On the other hand, an absolute path references files and directories starting from the root directory of the server. If we're in the same /uploaded/FTPeek/ directory and try to change into /temp, we would actually end up in /temp/ instead of /uploaded/FTPeek/temp/, since we start at the root directory instead of the current working directory. As seen in the examples, an absolute path starts with a slash /, while a relative one does not. Either can be passed in to FTPeek_UploadFile, FTPeek_ChangeDir, FTPeek_Rename and other functions to reference relative or absolute paths.

360Works Plugin Setup Guides

See Plugins_101 for Error reporting, installation, registration, and more.