![](/img/trans.png)
[英]Multiple threads uploading files to filezilla ftp server returns error 550 File unavailable
[英]Firewall blocking uploading a file in my filezilla server
我正在尝试设置Filezilla服务器。 我遵循了这里的指示。 我已经编写了一个简单的c#脚本,以便将数据上传到服务器。 我的代码如下:
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);
}
当我从同一台计算机运行该脚本时,一切工作正常。 当我尝试从同一局域网的另一台计算机运行同一脚本时,出现问题。 该文件未正确发送。 但是,当我关闭防火墙时,上传正常进行。 任何想法如何克服防火墙?
通常Windows会在尝试使用任何端口时要求用户授予程序许可权(Windows弹出弹出窗口,要求允许或禁止该程序使用该端口)...我不确定该怎么做但我发现了一个链接...
我不确定要显示此对话框需要满足什么条件,我假设尝试在普通Windows实例上打开侦听端口的应用程序应始终显示此对话框。 为什么不尝试将应用程序添加到“授权应用程序”列表中,或者不使用Windows防火墙COM互操作(NetFwTypeLib)手动打开端口?
引用alexw
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.