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 ?
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:
- 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
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