search

Home  >  Q&A  >  body text

php - Questions about multi-file upload on Android?

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.

迷茫迷茫2689 days ago887

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座2017-07-05 09:57:54

    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.

    reply
    0
  • 某草草

    某草草2017-07-05 09:57:54

    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.

    reply
    0
  • Cancelreply