Which is best way to upload the image into the server from android? I need to upload the multiple images into the specific folder and path to be returned from the server.
-
can you please some code samples of things you have tried? – thepoosh Feb 12 '14 at 07:36
-
1What is an Image Server in your case? If it's just a regular server, is FTP an option? You can even post it via HTTP if you have a web service to consume it. – Ali Feb 12 '14 at 07:41
2 Answers
I highly recommend you to use Square's Tape while your uploading multiple files/images at once looking at the ease of use, efficiency,error handling, queuing system. If you are using only one file at time try to use any of multi-part file upload in any android Http clients
This is what Square's Tape:
Tape is a collection of queue-related classes for Android and Java by Square, Inc.
QueueFile is a lightning-fast, transactional, file-based FIFO. Addition and removal from an instance is an O(1) operation and is atomic. Writes are synchronous; data will be written to disk before an operation returns. The underlying file is structured to survive process and even system crashes and if an I/O exception is thrown during a mutating change, the change is aborted.
An ObjectQueue represents an ordering of arbitrary objects which can be backed either by the filesystem (via QueueFile) or in memory only.
TaskQueue is a special object queue which holds Tasks, objects which have a notion of being executed. Instances are managed by an external executor which prepares and executes enqueued tasks.

- 19,894
- 12
- 72
- 105
You can find many many examples online to do that. Anyway, the way I do that is using HttpClient like this:
https://stackoverflow.com/a/2937140/812598
Good luck!