Start a Project

File upload from Android (via Multipart Form data)

Most of the time we have to upload our file on server from our Application but when we try to find a way we got all the different ways to do so that make us more confused. Some says to use some library and some says not to. So here is a method to upload a file to the server via Http Multi-part form data, it doesn’t need any external library and is quiet efficient as well.

Through it you can have a put request to send you file with extra data like in my case I have to send an additional reference tag along with it. So lets start. Here I am supposing that you have a File Adapter and you have selected the file you have to send. Basically you have the URI of the file. If you don’t please follow the  link.

So here are you. with this code you can send your file to server with extra form data.

Exit mobile version