How to upload file from android to server using file chooser?

I have to add file upload feature to my android app for upload any file using file chooser and the it upload to the server.For the Last 1 week I had searched lots of tutorials and Stackoverflow posts, but still no tutorials help me. So please post a sample code for upload a file(any format) to the server from android app ?

Answers


By using file chooser you will only get filelocation, So after getting file location you need to read it. There are two ways to upload file on server:

  1. Multipart file upload: You can upload file using Multipart file upload protocol defined by Apache foundation. but for that your server should also have handling for the same.

Following link will help you in implementing Multipart file upload

Using MultipartEntity in Android applications

2.Sending data on by traditional way of creating connection. below link has complete description and sample of uploading file to server: File Upload sample


Need Your Help

Flash file is not working in an html page

html actionscript-3 flash slideshow

I have a page that contains a Flash slideshow. Recently, it stopped working. If I access the file directly, then everything is fine, but when I want to load the slideshow in my HTML page doesn't w...

Turning a dataframe into a graph in R

r graph

Let's assume I have dataframe that looks like this: