1

when i tried to upload a file ., I had added httpmime-4.0.1 jar file.. i found a error in package declaration line..how can i clear this,,

ERROR

*Multiple markers at this line

-the type org.apache.james.mime4j.message.singlebody cannot be resolves , It is indirectly refrenced fron required .class files*

My Code.

     public void uploading() {
        //Url of the server
        String url = "http://192.168.1.125/ui-design1/newremote/sendgisttoall";
        HttpClient client = new DefaultHttpClient();
        HttpPost post = new HttpPost(url);
        MultipartEntity mpEntity = new MultipartEntity();
        //Path of the file to be uploaded
        File file = new File(filePath);
        ContentBody cbFile = new FileBody(file);         

        //Add the data to the multipart entity
        mpEntity.addPart("gistimage", cbFile);
        mpEntity.addPart("token", new StringBody(token, Charset.forName("UTF-8")));

        post.setEntity(mpEntity);
        HttpResponse response1 = client.execute(post);
        HttpEntity resEntity = response1.getEntity();
        String Response=EntityUtils.toString(resEntity);
        Log.d("Response:", Response);
  • I am not sure about the error, but read this answer and comments here: http://stackoverflow.com/a/1068132/1306419 . Hope it can be of some help. – Shobhit Puri Apr 26 '13 at 11:00
  • @Shobhit Puri : Thanx..i coded as like in the link only..But It showing same error. –  Apr 26 '13 at 12:00

0 Answers0