本帖最后由 fixed_2008 于 2011-04-06 15:13:31 编辑

解决方案 »

  1.   

    http://ext.group.iteye.com/group/blog/738366我觉得应该看下文档~
      

  2.   

    struts2 用的自动赋值 试了 File 对象 可是
    File f = common.getFileStr();
            System.out.println(f.getPath());
    却打印 
    “C:\Users\YZ\.IntelliJIdea10\system\tomcat\Unnamed_jd-pmpab5310fe\work\Catalina\localhost\_\upload_4e67f0dc_12f2994f625__8000_00000011.tmp”
    对吗?
      

  3.   

      BASE64吧,将文件转换成base64提交,实际上就是传输的字符串了,再在后台将这个字符串转成文件,至于文件名你传两个参数不就行了!
      

  4.   

    自己写一下 省的别人也不知道 xtype: 'fileuploadfield',
                id: 'formFile',
                emptyText: 'Select an image',
                fieldLabel: 'Photo',
                name: 'common.fileStr',
                fileUpload : true,
                buttonText: '',
                buttonCfg: {
                    iconCls: 'upload-icon'
                }文件名和 文件类型很好获得 
    如果用的是 struts2  只要在 对象bean 中 怎家两个属性
    比如 在 common 中 增加 fileStrType  和 fileStrFileName两个属性 Ext.fileuploadfield 组件 就会自动赋值。而 fileStr就是 Java.Io.File 对象 至于怎么应用大家都知道的。886
      

  5.   

    在submit中加入 params : {id : rec.get("id"),
              date : frm.findField("date").getValue()}
    在后台用String id = resquest.getParameter("id");得到后台传过来的id,
      

  6.   

    用fileuploadfield上传文件,如果想取消刚刚选中的文件怎么办