首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Exception >

sun.net.ftp.FtpProtocolException: PORT :501 PORT not allowed after EPSV ALL

2014-01-26 
FtpClient ftpClient new FtpClient() ftpClient.openServer(ent.getFtpAddress()) ftpClient.login(en

FtpClient ftpClient = new FtpClient();
ftpClient.openServer(ent.getFtpAddress());
ftpClient.login(ent.getFtpUser(), ent.getFtpPassword());
ftpClient.ascii();
ftpClient.cd(ent.getFtpPath());
String fg = new String( "\\ ");
int index = strPath.lastIndexOf(fg);
String filename = strPath.substring(index+1);
File localFile = new File(strPath);
RandomAccessFile sendFile = new RandomAccessFile(strPath, "r ");
sendFile.seek(0);
TelnetOutputStream outs = ftpClient.put(filename);
DataOutputStream outputs = new DataOutputStream(outs);
在java调用以上程序时,报错sun.net.ftp.FtpProtocolException: PORT :501 PORT not allowed after EPSV ALL
我直接在cmd中用ftp就可以,java调用就不行。
请教什么原因?如何解决?

------解决方法--------------------------------------------------------
帮忙顶,今天38,可能是有点怪的。
------解决方法--------------------------------------------------------
不会,友情帮顶
------解决方法--------------------------------------------------------
我也遇到这种情况,虽然程序后台报错,但是并不影响真正的上文件上传和下载

        

热点排行