Questions about downloading images to PHP on android
Source: Internet
Author: User
Android uploads images to PHP. I upload data to the PHP client via post. HttpPosthttpPost = newHttpPost (url + & quot ;? & Quot; + query); this method transmits parameters and URL addresses such as http: // 192.168.1.12/mapi /? Question about uploading images to PHP using api android
I upload data to the PHP client through post, HttpPost httpPost = new HttpPost (url + "? "+ Query); this method transmits parameters and URL addresses.
For example, http: // 192.168.1.12/mapi /? Api = "aa" & name = "bb"
InputStreamEntity inEntity = new InputStreamEntity (stream, stream. available ());
HttpPost. setEntity (inEntity)
Then, this method is used to upload images to the server, all in one request.
The question is, how can I obtain the stream for uploading images in php? the above parameters can be obtained through the key. how can I obtain the red image stream?
------ Solution --------------------
I think it is better for you to directly upload the file and then return the parameter to interact with php.
------ Solution --------------------
If the $ _ FILE variable has a value, a FILE is submitted.
------ Solution --------------------
Can android complete the upload part?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service