把你前台上传的jsp页面给我看看

解决方案 »

  1.   

    <s:form action=""  method="post" id="form1" enctype="multipart/form-data" theme="simple">
    <div class="container">
    <div id="forms" class="mt10">
            <div class="box">
              <div class="box_border">
                <div class="box_top"><b class="pl15">表单</b></div>
                <div class="box_center">
                    <table class="form_table pt15 pb15" width="100%" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td class="td_right">题目:
                        <s:fielderror>
                          <s:param>title</s:param>
                        </s:fielderror>
                        </td>
                        <td class=""><input type="text" name="title" id="title" class="input-text lh30" size="40">
                        &nbsp;&nbsp;
                        </td>
                      </tr>
                      <tr >
                        <td class="td_right">总分:
                        <s:fielderror>
                            <s:param>score</s:param>
                        </s:fielderror>
                        </td>
                        <td class=""><input type="text" name="score" id="score" class="input-text lh5" size="5">
                        &nbsp;&nbsp;
                        </td>
                      </tr>
                      <tr>
                        <td class="td_right">听力文件:
                        <s:fielderror>
                                <s:param>files</s:param>
                        </s:fielderror>
                        </td>
                        <td class="">
      <s:file name="files" class="input-text lh5" ></s:file>
                        </td>
                      </tr>
                      <tr>
                        <td class="td_right">是否加入题库:</td>
                        <td class="">
                        <select id="isshare" name="isshare" class="input-text">
                          <option value="0"> 否 </option>
                          <option value="1"> 是 </option>
                        </select></td>
                      </tr>
                      <tr>
                        <td class="td_right">&nbsp;</td>
                        <td class="">
                        <input type="submit" name="button" onclick="check()" class="btn btn82 btn_save2" value="下一步">
                            <input type="reset" name="button" class="btn btn82 btn_res" value="重置">                    </td>
                      </tr>
                    </table>
                </div>
              </div>
            </div>
     </div> 
    </div>
    </s:form>
      

  2.   

    上传的配置貌似不用这么复杂,就像正常的action一样
    update Action的方法,楼主不妨试一下我的:private File uploadFile;
    private String uploadFileFileName;   public String upload2() throws Exception {
            FileOutputStream fos = null;
            FileInputStream fis = null;
            try {
                fos = new FileOutputStream("D:\\" + getUploadFileFileName());
                 fis = new FileInputStream(getUploadFile());
                byte[] buffer = new byte[1024];
                int len = 0;
                while ((len = fis.read(buffer)) > 0) {
                    fos.write(buffer, 0, len);
                }
                System.out.println("上传成功");
            } catch (Exception e) {
                System.out.println("文件上传失败");
                e.printStackTrace();
            } finally {
             if (fis != null) {
                    try {
                        fis.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
                if (fos != null) {
                    try {
                        fos.close();
                    } catch (IOException e) {
                       e.printStackTrace();
                    }
                }
            }
            return SUCCESS;
        }
    public File getUploadFile() {
    return uploadFile;
    } public void setUploadFile(File uploadFile) {
    this.uploadFile = uploadFile;
    } public String getUploadFileFileName() {
    return uploadFileFileName;
    } public void setUploadFileFileName(String uploadFileFileName) {
    this.uploadFileFileName = uploadFileFileName;
    }
      

  3.   

    你的action都没有贴出来。。 你不别扭吗?
      

  4.   

    报什么错啊 贴出来 
    还有就是 你上传一个TXT试试 排除程序的问题