0

I want to upload all files of a folder to my PHP page.

That is, If I have several images inside a folder, and I want to upload (HTTP POST) all pictures in the folder to my PHP page, which then gets saved in my web directory by their respective file names.

How can I do that? I know about AsyncTask, but I am beginner in Android programming. I don't know how to make array or list or loops.

Ravi
  • 372
  • 1
  • 7
  • 24
  • Possible duplicate of [Uploading Images to Server android](https://stackoverflow.com/questions/20322528/uploading-images-to-server-android) – Shalu T D Aug 12 '19 at 13:48
  • @Shalu can you tell if this code is for uploading multiple images – Ravi Aug 14 '19 at 00:56

1 Answers1

0

AsyncTask is way too older, I am not saying we should not implement but has to take care of a lot of things if implemented!

Rather go with implementing RxJava based implementation but again since you are new to the android programming, so I would not suggest!

Since you are new to the android programming so we can say it's a long problem to solve. I would suggest you go steps wise steps. Let me give you pointers you would be searching, exploring and building around:

  • Find the directory in folders and iterate through each files to prepare a list
  • Two popular ways of uploading images: 1) Convert into Base64 and upload one by one 2) Multipart image upload
  • Instead of AsyncTask, you may use Retrofit Multipart image upload
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295