Example Code

Programmatically Upload to FTP Server using LabWindows/CVI

Code and Documents

Attachment

Overview
Programmatically upload a file to a desired FTP server.


Description
The attached code programmatically uploads a file to a desired FTP server, using LabWindows/CVI provided FTP client functions.

 

Using the FTP Client Capabilities

http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/libref/cviinternet_library_ftp/

 

Function Tree, Internet Library

http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/libref/cviinternet_library_function_tree/

 
Requirements

  • LabWindows/CVI 2010 (or compatible)


Steps to Implement or Execute Code

  1. Open “FTP Upload NIVerified.cws”.
  2. If your FTP server requires a username/password, change the “myusername” and “mypassword” variables on lines 35/36 in “FTP Upload NIVerified.c”
  3. Compile and run “FTP Upload NIVerified.c”
  4. In file select dialog that appears, select a file to upload.
  5. In the text dialog that appears, enter the desired filename.

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Regards,

Shawn S. | NIC
Instrument Driver/IVI PSE
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.