开发者

UnknownHostexception using apache commons

开发者 https://www.devze.com 2023-02-19 15:02 出处:网络
I am currently working with apache commons in my Project to gain access to my FTP Serv开发者_开发技巧er.

I am currently working with apache commons in my Project to gain access to my FTP Serv开发者_开发技巧er. Uploading a file is no problem at all, but If I want to download a file, I get an UnknownHost Exception what is strange because it is the same ftp server.

client.connect("ftp.liamissimo.li.ohost.de",21);
client.login("XXX", "XXX");
client.enterLocalPassiveMode();

This code works like this for uploading, but if I use it to download I got an UnknownHost exception.


I had a problem like this and I got it to work by using the IP of the hostname instead of the actual hostname...


check permissions in manifest file.

uses-permission android:name="android.permission.INTERNET"/>

0

精彩评论

暂无评论...
验证码 换一张
取 消