It is often useful to use FTP to transfer a 4D database. This tip will cover how to do it using either platform for users not familiar with FTP, as well as some specific issues for 4D databases.
Issues for 4D databases:
It is always important to archive your 4D database files (using winzip, stuffit, winRAR, or similar software) before uploading them to an FTP site. If the files are not archived then it is possible to lose the resources during the transfer. This is true of network transfers from one machine to another as well as FTP transfers. This problem is much less pronounced with 4D 2004 when compared to previous versions because most 2004 databases do not have resource forks, but it is still safer to archive the database files before transferring them.
Open a Windows Explorer window. This can be done simply by double-clicking your My Computer icon or My Documents. Windows Explorer is also accessible through the Start Menu: All Programs/Accessories/Windows Explorer.
Once this window is open simply type a string made up of the FTP account username, password, and server for your FTP account. This is the format for that string:
A screenshot of that example:
On a Windows machine this should be all you have to do, as at this point you can drag and drop a compressed 4D database into the Windows Explorer window or out of it.
We'll go over two different ways to transfer files with FTP on the Mac.
1. Use the built-in FTP client:
Once inside Terminal use the "cd "command to navigate to the folder wherein the file you would like to upload is stored, or to which you would like to download a file. For example:
To go to the Desktop. One way to get a list of current possible locations is using the "ls" command. Here is a screenshot of the use of that command and the "cd" command:
Once you are in the desired directory you must connect to the FTP server. To do that type the command "ftp (server name)". In (server name) input the server name, so from the last example the command would be "ftp myftpsite.4d.com". After this you will be prompted for a Name (user name to login), and Password.
Once you are in the FTP server the prompt in Terminal will read "ftp>" and at this point you can use the "put" and "get" commands to upload or download files, respectively. For example "put mydatabase.sit" will put mydatabase.sit into the current folder on the FTP site and "get mydatabase.sit" will copy it from the FTP site to your Desktop (if that is the current local directory).
Before you send or receive 4D databases using the Terminal it is important to use the "bin" command to change the transfer method from text to binary. All you need to do is type "bin" at the ftp> prompt and the mode will be changed.
That concludes how to upload and download files on the Terminal on the Mac OS.
2. Use 4D's demo database FTP Client
You can download this at:
The database is under the heading "FTP Client".
Once you have unstuffed this database all you need to do is run it in the latest version of 4D and go to the FTP Client screen at startup of the database, click the FTP Client button, and input your FTP information. Repeating a previous example from this tech tip you would input in the fields as follows:
FTP Domain: myftpsite.4d.com
And click connect. Here's a screen shot:
Once you're connected you can use the Get and Put buttons to transfer files. This FTP Client makes transfers very easy.
There are of course many other freeware and payware FTP clients available for MacOS and Windows. Feel free to experiment!