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

在java调用以上程序时,报错sun.net.ftp.FtpProtocolException:

2011-11-13 
请教:ftp服务器下载文件抛出异常501 PORT not allowed after EPSV ALL各位达人:FtpClientftpClientnewFtp

请教:ftp服务器下载文件抛出异常501 PORT not allowed after EPSV ALL
各位达人:
  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,可能是有点怪的。
[解决办法]
不会,友情帮顶
[解决办法]
我也遇到这种情况,虽然程序后台报错,但是并不影响真正的上文件上传和下载

热点排行
Bad Request.