Solved

How to Program CuteFTP 8 File Transfers

Posted on 2011-02-13
7
1,782 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
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.…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now