FTP testing ...

Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Mar 2008
Posts: 134
Reputation: cVz is an unknown quantity at this point 
Solved Threads: 7
cVz's Avatar
cVz cVz is offline Offline
Junior Poster

FTP testing ...

 
0
  #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";

  1. ***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 4:51 am.
Delphi & C# programmer deluxe...
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: FTP testing ...

 
0
  #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 Quick reply to this message  
Join Date: Mar 2008
Posts: 134
Reputation: cVz is an unknown quantity at this point 
Solved Threads: 7
cVz's Avatar
cVz cVz is offline Offline
Junior Poster

Re: FTP testing ...

 
0
  #3
Jan 7th, 2009
Ive got localhost ???
Delphi & C# programmer deluxe...
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: FTP testing ...

 
0
  #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 Quick reply to this message  
Join Date: Mar 2008
Posts: 134
Reputation: cVz is an unknown quantity at this point 
Solved Threads: 7
cVz's Avatar
cVz cVz is offline Offline
Junior Poster

Re: FTP testing ...

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

  1. private void FTP_Upload(object sender, EventArgs e)
  2. {
  3. FileStream fs_Upload = new FileStream(txtTo.Text + "/" + txtName.Text + ".zip", FileMode.Open, FileAccess.Read, FileShare.Read);
  4.  
  5. // Creating strings to hold values
  6. string m_server = txtftpServerName.Text;
  7. string m_username = txtftpUserName.Text;
  8. string m_password = txtftpPassword.Text;
  9. string m_UploadFile = fs_Upload.ToString();
  10. string m_directory = txtftpServerName + "Backups/";
  11.  
  12. m_ftp.Server = txtftpServerName.Text;
  13. m_ftp.Username = txtftpUserName.Text;
  14. m_ftp.Password = txtftpPassword.Text;
  15.  
  16. AsyncCallback m_callback = new AsyncCallback(CloseConnection);
  17.  
  18. try
  19. {
  20. // Logging in to the server
  21. m_ftp.Login();
  22.  
  23. // PROBLEM !!! ????
  24. m_ftp.RemotePath = ".";
  25. // PROBLEM !!! ????
  26. m_ftp.UploadDirectory("Backups/", false);
  27.  
  28. // Uploading the selected file
  29. m_ftp.Upload("c://DBNAME.bak.zip");
  30.  
  31. // Closing class
  32. m_ftp.Close();
  33. }
  34. catch (Exception Ex)
  35. {
  36. // Messagebox shows errors
  37. MessageBox.Show("File transfer protocol failed " + Ex.Message);
  38.  
  39. // Sending error Mail
  40. MailOnError(sender, e);
  41. }
  42.  
  43. Application.DoEvents();
  44. }

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 7:42 am.
Delphi & C# programmer deluxe...
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: FTP testing ...

 
0
  #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 Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC