[code]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) ; [/code]
乱码问题:
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[color=red],"UTF-8"[/color]);
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) ; [/code]
乱码问题:
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[color=red],"UTF-8"[/color]);