华少少华

BlogJava 首页 新随笔 联系 聚合 管理
  0 Posts :: 9 Stories :: 0 Comments :: 0 Trackbacks
 SmartUpload upLoad = new SmartUpload();   //SmartUpload组件
  try
  { 
   upLoad.initialize(getServlet().getServletConfig(),request,response);
   upLoad.upload();  or upLoad.upload(“。。”);  
  }
  catch (Exception e1)
  {
   // TODO Auto-generated catch block
   e1.printStackTrace();
  } 
  Request upLoadRequest = upLoad.getRequest();

String ext = upLoad.getFiles().getFile(0).getFileExt() ;  //得到后缀
String s = 地址+文件名;
upLoad.getFiles().getFile(0).saveAs(s) ;

乱码问题:
String  value  =  new  String(m_binArray,  m_startData,  (m_endData  -  m_startData)  +  1);  
这是smartupload  处理其他数据的时候使用的方法。  
string  如果没有encode  的情况下使用的是系统默认的。  
可能需要你重新编译这部分  
String  value  =  new  String(m_binArray,  m_startData,  (m_endData  -  m_startData)  +  1,"UTF-8");
posted on 2007-11-12 10:42 华少 阅读(97) 评论(0)  编辑  收藏 所属分类: java