FTP Support

v70 Native FTP Support

Starting with v70, the the following fields in the config.cfg file (or the “Edit Config Info” menu on the main TwoToneDetect screen) are can be used to have TwoToneDetect upload a recorded MP3 file to an FTP server:

upload_ftp_server =
upload_ftp_port =
upload_ftp_username =
upload_ftp_password =
upload_file_prefix =

The upload_file_prefix should be set to the web storage location where the audio files can be accessed via http.  For example: http://www.mywebsite/audiofiles/

v69 and Prior – ftpuploader script

ftpuploader is a simple command line script that is packaged with TwoToneDetect that can be used to upload the audio files recorded by TwoToneDetect to a web server via FTP.  This script is packaged as a .exe file for use on Windows, and is also provided as a raw .py source file for use on Linux or on Windows systems that have Python installed.

Windows EXE command line usage is as follows:

ftpuploader filename host username password --port(opt.) --remotepath(opt.)

The optional –port parameter can be used to set a port other than 21 (default) for the FTP connection.

The optional –remotepath parameter can be used to set the path on the remote server to upload the file to (other than the root FTP directory).  For example, to put the file in the /audio folder on the remote server, use “–remotepath /audio/”.

As an example, to use ftpuploader to upload the mp3 audio file that TwoToneDetect creates to a web server, put ftpuploader in the same directory as TwoToneDetect and then put the following into the post_email_command field for that tone set:

ftpuploader [mp3] ftp.mywebsite.com myusername mypassword

TwoToneDetect will substitute the name of the file (and path relative to the TwoToneDetect program directory) that was created in place of the [mp3] tag in the argument when calling ftpuploader.

Sending a Hyperlink via SMS

To send a hyperlink to the web address of the file that was uploaded via FTP, set the “Email Body” field in the TonesEditor program to the root web address, and use the [mp3] tag to insert the filename of the file that was uploaded to the web server.  Note that the [mp3] tag includes the relative path to the file.  For example:

Setting “Email Body” to:   http://www.myfd.org/[mp3]

will send this hyperlink in the body of the message: