1

MulitPartEntity を使用してテキスト ファイルをアップロードしようとしましたが、アップロードできません..私のコードは以下に記載されています。助けてください..

 File file = new File("/sdcard/" + strEmailAddress + ".txt");
    HttpClient httpclient = new DefaultHttpClient();

                HttpPost httppost = new HttpPost(strUrl);


        MultipartEntity reqEntity = new MultipartEntity(
                    HttpMultipartMode.BROWSER_COMPATIBLE);

            if (file.exists()) {
                Helper.printLogD(" file is exist ");
            }
            FormBodyPart bodyPart = new FormBodyPart("userfile",
                    (ContentBody) file);


        reqEntity.addPart(bodyPart);


        httppost.setEntity(reqEntity);

HttpResponse response = httpclient.execute(httppost);
4

0 に答える 0