/*#CODE
{
   FILE *srcFD;
   char url[128], *c;
#if !defined (NEUTRINO_INTEGRATION)
   char logon[32];
#endif
   int i;
   CURL *curl;
   CURLcode res;
   long init_flags = 0;
   struct stat sbuf;
   char errorBuffer[CURL_ERROR_SIZE];
   char *pBuff = errorBuffer;

   // convert back to forward slashes of the destination file
   c = #(dstFile);
   for (i=1; *c!='\0'; i++,c++)
      if (*c == '\\')
         *c = '/';
   //  open the local (source) file
   srcFD = fopen(#(srcFile)+1, "rb");

#if !defined (NEUTRINO_INTEGRATION)
   init_flags = CURL_GLOBAL_WIN32;
#endif
   res = curl_global_init(init_flags); 
   if (res == CURLE_OK)
      {
      curl = curl_easy_init();
      if(curl)
         {
         sprintf(url,"ftp://%s%s",(#(destination))+1,(#(dstFile))+1);
         curl_easy_setopt(curl, CURLOPT_UPLOAD, 1) ;
         curl_easy_setopt(curl, CURLOPT_URL, url);
         curl_easy_setopt(curl, CURLOPT_READDATA, srcFD);
         if ( stat( #(srcFile)+1, &sbuf ) == 0 ) {
            curl_easy_setopt(curl, CURLOPT_INFILESIZE, (long)sbuf.st_size);
         }
#if defined (NEUTRINO_INTEGRATION)
         curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_REQUIRED);
#else
         curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_ftp_data);
         sprintf(logon,"%s:%s",(#(ftpUser))+1,(#(ftpPassword))+1);
         curl_easy_setopt(curl, CURLOPT_USERPWD, logon);
#endif
         if (#(ftpProgress) != NULL) {
            curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
            curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, #(ftpProgress));
            curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, ftp_progress_callback);
            curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, pBuff);
         }
         res = curl_easy_perform(curl);
         if (res != CURLE_OK){
            #(ftpResult) = #(FILE_COPY_ERROR);
            debugPrintf (1,"\n\tcurl_easy_perform returns [%d], errorstring = [%s]\n"
            "\tdestination = [%s], sourcefile = [%s]\n\n", res, pBuff, #(destination), #(srcFile));         
            }

         curl_easy_cleanup(curl);
         }
      else
         #(ftpResult) = #(FILE_COPY_ERROR);
      }
   else
   #(ftpResult) = #(FILE_COPY_ERROR);

   curl_global_cleanup();

   if (srcFD)
      fclose(srcFD);
}
*/



