日期:2014-05-18  浏览次数:20989 次

为何还出错?
我下载了smartupload包
然后添加到了classpath里和WEB-INF里的lib下了,不过在使用里还出错
我的代码是:
<%@   page   contentType= "text/html;charset=gb2312 "   %>
<%@   page   import= "com.jspsmart.upload.* "   %>
<html>
        <head>
                <title> uplaod </title>
        </head>
        <body>
                <%  
                        SmartUpload   su=new   SmartUpload();
                        su.initialize(pageContext);
                        su.setMaxFileSize(200*1024*1024);
                        su.upload();
                       
                        for(int   i=0;i <su.getFiles().getCount();i++){
                                com.jspsmart.upload.File   file=su.getFiles().getFile(i);
                                if(!file.isMissing()){
                                        String   tfilename=file.getFileName();
                                        String   suffix=tfilename.substring(0,tfilename.lastIndexOf( '. '));
                                       
                                        String   ext=su.getFiles().getFile(0).getFileExt();
                                        int   filesize=file.getSize();
                                       
                                        String   savepath=getServletContext().getRealPath( "/ ")+ "upload\\ ";
                                        String   trace=savepath+tfilename;
                                       
                                        file.saveAs(savepath,Save_PHYSICAL);