RSS Forums RSS

FTP testing ...

Please support our C# advertiser: DiscountASP.NET – 3 Months Free on C# Web Hosting
Reply
Posts: 117
Reputation: cVz is an unknown quantity at this point 
Solved Threads: 6
cVz's Avatar
cVz cVz is offline Offline
Junior Poster

FTP testing ...

  #1  
Jan 7th, 2009
Hi there,

I would like to know if there is any default settings one can use to test FTP settings etc, i am doing an application that does database backups , then zips the backup and FTP it to the server, i believe it is working because at the moment i am using these settings

ftp.Server = "ftp.secureftp-test.com";
ftp.Username = "test";
ftp.Password = "test";

***FTP refers to the class i wrote that handles the ftp

Now this works all good and all but ftp.secureftp-test.com obviously declines my attempt to upload the files, does anyone know any better idea or location ??

Thanks in advance...

mr VonZipper
Last edited by cVz : Jan 7th, 2009 at 3:51 am.
Delphi & C# programmer deluxe...
AddThis Social Bookmark Button
Reply With Quote  
Posts: 1,734
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 184
LizR LizR is offline Offline
Posting Virtuoso

Re: FTP testing ...

  #2  
Jan 7th, 2009
Load an FTP server onto your pc.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote  
Posts: 117
Reputation: cVz is an unknown quantity at this point 
Solved Threads: 6
cVz's Avatar
cVz cVz is offline Offline
Junior Poster

Re: FTP testing ...

  #3  
Jan 7th, 2009
Ive got localhost ???
Delphi & C# programmer deluxe...
Reply With Quote  
Posts: 1,734
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 184
LizR LizR is offline Offline
Posting Virtuoso

Re: FTP testing ...

  #4  
Jan 7th, 2009
as long as theres an FTP server on it, yes, you can use localhost.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote  
Posts: 117
Reputation: cVz is an unknown quantity at this point 
Solved Threads: 6
cVz's Avatar
cVz cVz is offline Offline
Junior Poster

Re: FTP testing ...

  #5  
Jan 7th, 2009
Cool , i realized my problem is not my actual domain, its the path i"m specifying, so i have this

private void FTP_Upload(object sender, EventArgs e)
        {
            FileStream fs_Upload = new FileStream(txtTo.Text + "/" + txtName.Text + ".zip", FileMode.Open, FileAccess.Read, FileShare.Read);

            // Creating strings to hold values
            string m_server = txtftpServerName.Text;
            string m_username = txtftpUserName.Text;
            string m_password = txtftpPassword.Text;
            string m_UploadFile = fs_Upload.ToString();
            string m_directory = txtftpServerName + "Backups/";

            m_ftp.Server = txtftpServerName.Text;
            m_ftp.Username = txtftpUserName.Text;
            m_ftp.Password = txtftpPassword.Text;

            AsyncCallback m_callback = new AsyncCallback(CloseConnection);

            try
            {
                // Logging in to the server
                m_ftp.Login();

                // PROBLEM !!! ????
                m_ftp.RemotePath = ".";
               // PROBLEM !!! ????
                m_ftp.UploadDirectory("Backups/", false);

                // Uploading the selected file
                m_ftp.Upload("c://DBNAME.bak.zip");

                // Closing class
                m_ftp.Close();
            }
            catch (Exception Ex)
            {
                // Messagebox shows errors
                MessageBox.Show("File transfer protocol failed " + Ex.Message);

                // Sending error Mail
                MailOnError(sender, e);
            }

            Application.DoEvents();
        }

I am uncertain about the "m_ftp.UploadDirectory("Backups/", false);" part , because it tries to FTP to my own PC, is there any other way of setting a path on a server ??

The Path should be Root -> Backups -> File must save here

Any help Please ...
Last edited by cVz : Jan 7th, 2009 at 6:42 am.
Delphi & C# programmer deluxe...
Reply With Quote  
Posts: 1,734
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 184
LizR LizR is offline Offline
Posting Virtuoso

Re: FTP testing ...

  #6  
Jan 7th, 2009
"Root->Backups" whats this? this isnt a directory format, simple answer you need to log in using a command line ftp to your ftp server, look at the directories it gives you and work out the path relative to where you want to go and then change to it.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the C# Forum
Views: 401 | Replies: 5 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:18 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC