OxOIII 2014-05-18 03:42 采纳率: 66.7%
浏览 2553

取出Stringbuffer.append中的指定字符串。

客户端StringBuffer sb = new StringBuffer(); 1. sb.append("Content-Disposition: form-data; name=\"img\"; filename=\""+file.getName()+"\""+LINE_END); 2. sb.append(itemId) ;//itemId是int类型,已定义 3. sb.append("Content-Type: application/octet-stream; charset="+CHARSET+LINE_END); 4.dos.write(sb.toString().getBytes()); 服务器端try { 1.List items = this.upload.parseRequest(request); 2.if(items!=null && !items.isEmpty()){ 3.for (FileItem fileItem : items) { 4.String filename=fileItem.getName(); 5. String itemId=fileItem.getString();//拿出传过来的itemId 为什么客户端第4句定义了itemid,在服务器端第5句拿出的是乱码?

  • 写回答

1条回答

  • LinY_X 2014-05-20 03:32
    关注

    有没有设置编码集utf-8?

    评论

报告相同问题?

悬赏问题

  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容