?
Solved

How to Program CuteFTP 8 File Transfers

Posted on 2011-02-13
7
Medium Priority
?
1,901 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 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