Index: src/backend/Makefile
===================================================================
--- src/backend/Makefile	(revision 2655)
+++ src/backend/Makefile	(working copy)
@@ -15,7 +15,7 @@
 LIBS= $(LIBRARY) -L ../generator -lparser 
 
 #Ticket-SmartDNS: link with sdns cli lib
-LIBS+= -lcrypt -lcurses -lxml2 \
+LIBS+= -lcrypt -lcurses -lcurl -lxml2 \
        -L${TOP}/lib/feactl -lfeactl \
        -L ../library/ca_util -lcautil -L ../library/ca_ui -lcaui -L ../library/node_man -lnode \
        -L$(TOP)/src/library/management -lsuppress_print \
Index: src/backend/sys_cmd.c
===================================================================
--- src/backend/sys_cmd.c	(revision 2664)
+++ src/backend/sys_cmd.c	(working copy)
@@ -45,8 +45,8 @@
 #include <errno.h>
 #include <dirent.h>
 #include <syslog.h>
+#include <curl/curl.h>
 
-//#include "avx_model.h"
 #include "cm_feactl.h"
 #include "cm_ul.h"
 
@@ -602,6 +602,49 @@
 
 	return transfer_files_via_scp_real(EXPORT_FILES_VIA_SCP, filename, remote, pass);
 }
+
+int ftp_upload(char* userpasswd, char *src, char* ftpurl)
+{
+    FILE *file;
+    CURL *curl;
+    CURLcode res;
+
+    curl_global_init(CURL_GLOBAL_DEFAULT);
+    curl = curl_easy_init();
+
+    file = fopen(src, "rb");
+    if (!file) {
+	printf("Unable to open file: %s\n", src);
+        return -1;
+    }
+    int ret = 0;
+    if (curl) {
+        fseek(file, 0L, SEEK_END);
+        curl_off_t fsize = ftell(file);
+        fseek(file, 0L, SEEK_SET);
+
+        curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
+        curl_easy_setopt(curl, CURLOPT_URL, ftpurl);
+        curl_easy_setopt(curl, CURLOPT_READDATA, file);
+        curl_easy_setopt(curl, CURLOPT_USERPWD, userpasswd);
+        curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, fsize);
+
+        res = curl_easy_perform(curl);
+        if (res != CURLE_OK) {
+            printf("Upload failed: %s\n", curl_easy_strerror(res));
+	    ret = -1;
+        }
+        else {
+            printf("Upload complete\n");
+	    ret = 0;
+	}
+        curl_easy_cleanup(curl);
+    }
+    fclose(file);
+    curl_global_cleanup();
+    return ret;
+}
+
 int
 debug_ftp(char *filename, char * host, char* path, char *usr)
 {
@@ -642,8 +685,7 @@
 	snprintf(usrpasswd, MAXUSRPASSLEN, "%s:%s", usr, password);
 	char ftpurl[MAXLEN] = { 0 };
 	snprintf(ftpurl, MAXLEN, "ftp://%s/%s%s%s", host, path, path[strlen(host) - 1] == '/' ? "" : "/", destfile);
-/*	return ftp_upload(usrpasswd, src, ftpurl);*/
-	return 0;
+	return ftp_upload(usrpasswd, src, ftpurl);
 }
 
 static int
