丵鹰 2017-06-08 01:54 采纳率: 0%
浏览 1924
已采纳

读取zip文件,然后根据读取的数据在创建个zip

功能接收zip文件流,然后创建zip文件,现在想自己先写个demo读取zip文件,然后根据读取的数据在创建个zip

  • 写回答

2条回答 默认 最新

  • itjava2017 2017-06-22 07:07
    关注
     HttpPost httppost = new HttpPost(url);  
    
                FileBody bin = new FileBody(new File(zipPath));  //zipPath压缩包路径
                StringBody comment = new StringBody(zipName);  
                Charset charSet=Charset.forName("UTF-8");
                StringBody context = new StringBody(obj.toString(),charSet); 
                HttpEntity reqEntity =MultipartEntityBuilder.create().addPart("file", bin).addPart("filename", comment).build();
                httppost.setEntity(reqEntity);
                HttpResponse response = httpclient.execute(httppost);  
                int statusCode = response.getStatusLine().getStatusCode(); 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?