简体   繁体   English

寻找用于Android(Java)的HTML(PHP)中使用的结构的上传文件类型

[英]Looking for an upload file type of structure used in HTML (PHP) for Android (Java)

Looking for an upload file type of structure used in HTML for Android (Java) The HTML + PHP version can be seen in the following link http://www.w3schools.com/php/php_file_upload.asp 寻找用于Android(Java)HTML的结构的上传文件类型。HTML + PHP版本可在以下链接中找到:http://www.w3schools.com/php/php_file_upload.asp

Do we have something like this for Android (Java)? 我们在Android(Java)中是否有类似的东西?

yes u can upload file to server using php as a backend all u need to do is to use the httpmultipart lib for uploading the files. 是的,您可以使用php作为后端将文件上传到服务器,您所需要做的就是使用httpmultipart库上传文件。 Go apache's website and download the latest http multipart lib and add it to ur project. 转到apache的网站,下载最新的http multipart库并将其添加到ur项目中。 create a php page and u don't need html page if u are uploading it from android. 创建一个php页面,如果您是从android上传的,则不需要html页面。

use http client for making request. 使用http客户端发出请求。 but please make sure which method ur using to upload file to ur server. 但请确保您使用哪种方法将文件上传到您的服务器。 if u are using post request for uploading from android then u must use $_post method in php and if ur using get method u must use $_get method in ur php page. 如果您使用发布请求从android上传,那么您必须在php中使用$ _post方法,如果您使用get方法,则必须在php页面中使用$ _get方法。 otherwise it will jot work. 否则它将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM