將文件從我的模擬器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