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 7:42 am.
Delphi & C# programmer deluxe...