问题上传图像到Android应用程序在本地主机应用程序、图像、主机、上传

2023-09-07 11:46:11 作者:阳光不阳光

我开发一个Android应用程序,其中我要上传图片到本地主机,我创建了一个数据库,也把php文件,,,,,

I am developing an android application, in which I have to upload image to a local host, I have created a database, also put the php file,,,,,

我做R&放大器; d.and在此URL尝试的方式uploading在Android的文件中使用仿真器和本地系统

I did r&d.and tried the way in this url uploading files in android using emulator and localsystem

但没有获得成功.....我的本地主机地址是的http://localhost/connect1.php

But did not get success..... My localhost url is http://localhost/connect1.php

任何人都可以指导我如何上传图片到本地主机?

Can anyone guide me how to upload image to a local host?

推荐答案

该网址的http://本地主机仅在您的计算机上有效。为Android找到服务器,它需要一个真正的URL。

The URL http://localhost is only valid on your computer. For Android to find the server, it will need a real url.

有关的发展,如果你没有一个官方网址暂时还,你可以把你的本地无线网络上您的手机和使用本地网络服务器的IP地址。要获取IP地址,运行 IPCONFIG (Windows)或使用ifconfig (Linux版)。因此,您的网址将会像 http://10.23.234.12/connect1.php

For development, if you don't have an official URL yet, you can put your phone on your local wireless network and use the IP address of your local webserver. To get the ip address run ipconfig (windows) or ifconfig (linux). So your url will be something like http://10.23.234.12/connect1.php