代码如下:
foreach (FileInfo file in dir.GetFiles())
{
string s = file.FullName;
string ss = remotePath + file.Name;
ftpClient.Put(file.FullName, remotePath + "/" + file.Name);
MoveFile(file.FullName, ht["BackPath"].ToString()+file.Name);
SaveLog("上传文件" + file.Name + "成功!(" + DateTime.Now.ToString() + ")", ht["LogPath"].ToString(), ht["Logext"].ToString());
}
catch(Exception e)
{
SaveLog("发生错误:" + e.Message, ht["LogPath"].ToString(), ht["Logext"].ToString());
}
在ftpClient.Put(file.FullName, remotePath + "/" + file.Name);执行这句话时,出现异常,Can't access file. (code=550)。
请大神解决,thanks。
------解决思路----------------------
没权限 put,那么有没有权限下载这个文件呢?
------解决思路----------------------
有可能权限问题
还有文件名是不是中文的,非英文的话要设置编码类型