I am trying to setup a filezilla server. I have followed the instructions from here. I have write a simple c# script in order to upload data to server. My code is the following:
static void UploadFile(string filepath)
{
string m_FtpHost = "ftp://ip:port/";
string m_FtpUsername = "user";
string m_FtpPassword = "pass";
// Get an instance of WebClient
WebClient client = new System.Net.WebClient();
// parse the ftp host and file into a uri path for the upload
Uri uri = new Uri(m_FtpHost + new FileInfo(filepath).Name);
// set the username and password for the FTP server
client.Credentials = new System.Net.NetworkCredential(m_FtpUsername, m_FtpPassword);
// upload the file asynchronously, non-blocking.
client.UploadFileAsync(uri, "STOR", filepath);
}
When I am running that script from the same computer everything is working fine. When I trid to run the same script from another computer of the same lan I got issues. The file doesnt sent it properly. When I turn off the firewall however the upload is happerning normally. Any idea how to get over the firewall?
Usually the Windows asks the user to give permission to a program when it tries to use any port (the Windows get's a pop out asking to allow or disallow the program from using the port ) ... I'm not sure how to do it but I found a link ...
I'm not sure what conditions need to be met to expose this dialog, I would assume an application that attempts to open a listening port on a vanilla Windows instance should always display this dialog. Why don't you try adding your application to the 'authorized applications' list, or opening the port manually using the Windows Firewall COM interop (NetFwTypeLib)?
quoted from alexw