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.

2
  • Possible duplicate of Uploading Images to Server android Commented Aug 12, 2019 at 13:48
  • @Shalu can you tell if this code is for uploading multiple images Commented Aug 14, 2019 at 0:56

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

3 Comments

Can you give the code for just second part - TO DO MULTIPART REQUEST.
Ready made code? That's not possible, did you check on Google? Lot of examples are available. Since you are a newbie in Android so I thought to saw you a direction.
Can't you provide link to those examples?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.