1

I need to send the multi parameter in form data while uploading a file to server on Android. I used this code for uploading a files to server. Here my doubt is how to send multi parameters in form data?

1
  • Holy crap, don't use that code. See here or here etc. Commented Jan 6, 2012 at 22:41

1 Answer 1

1

You'll probably want to use the Apache HTTP client stuff. Put a List<NameValuePair> of your desired values into a UrlEncodedFormEntity, set it as the entity in an instance of HttpPost, and POST away.

Apache HTTP Client JavaDocs for Android are here.

Sign up to request clarification or add additional context in comments.

1 Comment

@bharath I thought you wanted to send form data. There's a ByteArrayEntity and a FileEntity if that's what you want to send. And an InputStreamEntity if you don't necessarily want to load up everything in memory first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.