Transferring Files to an FTP Server from a LabVIEW Real-Time Controller

Updated Jun 13, 2024

Environment

Software

  • LabVIEW Real-Time Module
  • LabVIEW

This guide goes through the steps on how to transfer files to an FTP Server using FTP clients from a LabVIEW Real-Time Controller and does not provide additional information on how to do this programmatically. If you wish to transfer the files programmatically please take a look at the related links section.


There is a number of parameters that are necessary to know when connecting to an FTP server:
  • FTP server name or IP address
  • Port number (default: 21)
  • Username (default: anonymous)
  • Password
In many cases all you need to actually know is the FTP server's name or IP address. This is because often a default value is used for the other parameters. The default port number is 21. The default username usually used for publicly-available FTP servers is anonymous. Some FTP servers will accept anonymous as password or even a blank password, while others will check if you entered an email address. It is generally recommended that you use your email address for the password.

There are four basic ways to communicate with an FTP server:

Use a Windows Explorer Window

​A simple way to use FTP is through a Windows Explorer window. To do this, open a Windows' File Explorer window and type ftp://[server name] or ftp://X.X.X.X where 'X' symbolizes the IP address of the FTP server, e.g. the IP address of your cRIO controller. You can then copy and paste files to or from the server like you would do with any normal folder on your storage as well.


 

Use a web browser as your FTP client

Most web browsers will work as an FTP client. They are particularly easy to use if your goal is to download something from the FTP server you are connecting to. By default, web browsers do not support uploading files onto an FTP server or deleting files from it as easy as Windows File Explorer does. Add-ons exist for some browsers to allow this functionality.

In general, type the address of your FTP server into the URL bar of your web browser, e.g. ftp://ftp.ni.com.
The ftp:// in front of the address string tells your web browser to use the FTP protocol. When you use this protocol, the default port number, username, and password are used. If you need to connect to an FTP server running on a different port or with a different username or password, you can put additional information into the address using this format: ftp://[username]:[password]@ftp_server_name:[port].
Once connected, depending on your web browser, use basic Windows operations to access the files. Usually either single- or double-clicking on a file will download it. Doing the same to a folder will open that directory. To upload a file, try dragging and dropping it from your Windows computer into the web browser window. As mentioned, this does only work in some web browsers. A few other possible causes for uploading errors is that some FTP servers do not allow write access, do not accept files with spaces in the file name, or do not accept files with long file names.

Use a graphical FTP client

Windows does not come with a dedicated graphical FTP client program. You would need to download one. They vary in quality and price, from the free and open-source 3rd-party FileZilla (available for macOS and Linux as well)  to commercial FTP clients. In general, a dedicated FTP client is more powerful and easier to use than three other approached described on this page.

Use the command-prompt FTP client

Starting with Windows 95, Windows comes with a command-line FTP utility. While not as easy to use as Internet Explorer for some operations, things like uploading files are more reliable using this method. To use this utility, launch a command prompt in Windows, type ftp, and hit enter. This utility operates almost identically to the UNIX-based utility of the same name which has been around for many years. If you are unfamiliar with this utility, the most useful command is simply ?. Entering this command and pressing enter will display a list of commands that the command-line FTP client understands. You can then type ? [command] to display a brief line of help about that command. See Microsoft's Command-Line Reference on FTP for a list of commands.