Upload file by HTTP POST
I want to upload a file (an image specifically) to a REST Server using HTTP POST . I have already imported/add to build path httpmime-4.3.1.jar and apache-mime4j-0.6.jar . And I am getting the follow errors below in the Stack Trace. Is this valid? post.setHeader("enctype", "multipart/form-data"); HTTP POST Code public void multiPartPost() throws ClientProtocolException, IOException { File image = new File(EXTERNALSTORAGE + "/Pictures/sample.jpg"); FileBody fileBody = new FileBody(image); HttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost(url); post.setHeader("enctype",