php - Questions about multi-file upload on Android?
迷茫2017-07-05 09:55:54
0
2
898
Recently I am doing multi-file upload on Android. The background php is processed by move_upload_files(). How to handle multi-file upload on Android? Someone please guide me.
Let the Android side simulate post file upload, and then the PHP background processes it according to the normal file upload similar to the web page.
If there are multiple pictures, our Android says there is no way to upload them in the form of a[] array with name, so it is stipulated that if there are 3 pictures, the names are: img_1, img_2, img_3, and the number of pictures num is passed at the same time. , after the php background gets the num, a for loop is used to obtain and save the files with assembly names img_1, img_2, and img_3. So it’s not very clear whether Android can use name as an array to upload. If you know, please tell me. The above is a compromise method.
I just asked Android to put the image data in the hashMap object
If there are multiple pictures, the key is file[], and the key for one picture is file. The value is the data above. . Form key-value pairs. Just pass it to the background.
Let the Android side simulate post file upload, and then the PHP background processes it according to the normal file upload similar to the web page.
If there are multiple pictures, our Android says there is no way to upload them in the form of a[] array with name, so it is stipulated that if there are 3 pictures, the names are: img_1, img_2, img_3, and the number of pictures num is passed at the same time. , after the php background gets the num, a for loop is used to obtain and save the files with assembly names img_1, img_2, and img_3.
So it’s not very clear whether Android can use name as an array to upload. If you know, please tell me. The above is a compromise method.
I just asked Android to put the image data in the hashMap object
If there are multiple pictures, the key is file[], and the key for one picture is file. The value is the data above. . Form key-value pairs. Just pass it to the background.