Solved

How to Program CuteFTP 8 File Transfers

Posted on 2011-02-13
7
1,840 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

685 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