Solved

How to Program CuteFTP 8 File Transfers

Posted on 2011-02-13
7
1,828 Views
Last Modified: 2012-05-11
I am using the CuteFTP Pro 8 interface to manually transfer files from my local directory to a remote site that I have permissions for.

Can this be done programatically?

Could you give me references?

Thanks,
0
Comment
Question by:Dovberman
  • 6
7 Comments
 

Expert Comment

by:botweb
ID: 34882536
You need to write a Visual Basic Script as described in the docs http://help.globalscape.com/help/cuteftppro8/index.htm#About_the_Transfer_Engine.htm
0
 

Assisted Solution

by:Dovberman
Dovberman earned 0 total points
ID: 34887979
It will take a while to learn how to use the transfer engine.

For a given example:

Set MySite = CreateObject("CuteFTPPro.TEConnection")

MySite.Protocol = "FTPS_IMPLICIT "

MySite.Host = "ftp.ftp.net" >

MySite.Port = 990

MySite.Login = "username"

MySite.Password = "password"

MySite.Connect

Can C# be used?

Can this be placed in the code behind file?
0
 

Assisted Solution

by:Dovberman
Dovberman earned 0 total points
ID: 34888527
I called CuteFTP support.  Use of the transfer engine and coding is not supported in Windows 7.

What other FTP client software is available that can be programatically controlled?

Thanks,
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Accepted Solution

by:
Dovberman earned 0 total points
ID: 34910828
Here is how it is done using Code Behind:


protected void cmdUploadFiles_Click(object sender, EventArgs e)
    // Upload files from the local machine to the FTP Site

    // Get the object used to communicate with the server.
    {
        FtpWebRequest UploadRequest;
        StreamWriter UploadStreamWriter;
        //StreamReader UploadStreamReader;
        string strUriTarget = "ftp://ftp.StockPickerMax.com/Data/";

        // Get source and destination file names
        string[] strFileTarget;
        string[] strArrayTarget = new string[3];
        strArrayTarget[0] = strUriTarget + "AMEX.txt";
        strArrayTarget[1] = strUriTarget + "NASDAQ.txt";
        strArrayTarget[2] = strUriTarget + "NYSE.txt";

        string[] strFileName;
        string[] strArraySource = new string[3];
        strArraySource[0] = "AMEX.txt";
        strArraySource[1] = "NASDAQ.txt";
        strArraySource[2] = "NYSE.txt";

        string strSourceBase = "C:\\Develop\\Apps\\StockPro\\";
        string strSourcePath = strSourceBase + "Data\\";

        string strResponse = "";
        string strSourceFile = "";
    
        // Transfer files
        for (int intCtr = 0; intCtr <= 2; intCtr++)
        {
            Uri UriFileTarget = new Uri(strArrayTarget[intCtr]); //Uri("ftp://ftp.StockPickerMax.com/Data/AMEX.txt");
            UploadRequest = (FtpWebRequest)WebRequest.Create(UriFileTarget);
            UploadRequest.Credentials = new NetworkCredential("MyUserName", "MyPassword");
            UploadRequest.UseBinary = true;
            UploadRequest.Method = WebRequestMethods.Ftp.UploadFile;
            
            // Copy the contents of the file to the request stream.
          
            strSourceFile = strSourcePath + strArraySource[intCtr];

            StreamReader SourceStream = new StreamReader(strSourceFile);
            byte[] fileContents = Encoding.UTF8.GetBytes(SourceStream.ReadToEnd());
            SourceStream.Close();
            UploadRequest.ContentLength = fileContents.Length;
            Stream RequestStream = UploadRequest.GetRequestStream();
            RequestStream.Write(fileContents, 0, fileContents.Length);
            RequestStream.Close();

            FtpWebResponse UploadResponse = (FtpWebResponse)UploadRequest.GetResponse();
            strResponse = UploadResponse.StatusDescription.ToString();
        }

Open in new window

0
 

Assisted Solution

by:Dovberman
Dovberman earned 0 total points
ID: 34910838
I solved it myself
0
 

Assisted Solution

by:Dovberman
Dovberman earned 0 total points
ID: 34910843
I solved it yself
0
 

Author Closing Comment

by:Dovberman
ID: 34958994
Please close this question.  I do not care who gets the points.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question