将文件从我的模拟器sdcard上传到本地wampserver时出现此错误。从android sdcard上传文件时出错
03-22 10:46:15.459: ERROR/Debug(487): error: localhost/127.0.0.1:80 - Connection refused
示例代码
String urlString = "http://localhost/uploads/index.php";
try
{
//------------------ CLIENT REQUEST
FileInputStream fileInputStream = new FileInputStream(new File(existingFileName));
// open a URL connection to the Servlet
URL url = new URL(urlString);
谁能告诉我这是什么错误意味着什么,我要怎样才能避免呢?
我在同一台计算机上运行服务器和模拟器,我也尝试了在浏览器中由异常127.0.0.1:80引起的ip addess,现在我得到了这个ip页面,但是在emuator icant – 2011-03-22 05:29:42
@ user664525 127.0.0.1是由localhost/loopback定义的IP,它将始终引用本地设备,除非是别名。您需要在网络上找到主机的IP。 – 2011-03-22 05:39:40