<!-- Sample file upload stack -->
<interceptor-stack name="fileUploadStack">
<interceptor-ref name="fileUpload"/>
<interceptor-ref name="basicStack"/>
</interceptor-stack>我看了下 struts jar包 ,也许这2个拦截器是突破口 你这种只能直接修改struts源码或者修改 struts-default.xml
<interceptor-stack name="fileUploadStack">
<interceptor-ref name="fileUpload"/>
<interceptor-ref name="basicStack"/>
</interceptor-stack>我看了下 struts jar包 ,也许这2个拦截器是突破口 你这种只能直接修改struts源码或者修改 struts-default.xml
你也可以在上传的时候自己创建临时文件夹,然后指定路径上传到你的文件夹,参考一下://File pic; String picFileName; 多文件上传改成数组.newName = UUID.randomUUID().toString() + "."+ FilenameUtils.getExtension(yspicFileName);
String patns = ServletActionContext.getRequest().getRealPath("") + "/temp";
File dir = new File(patns);
if (!dir.exists())
dir.mkdirs();
File f = new File(dir, newName);
FileUtils.copyFile(yspic, f);
我用的uploadify写的一个小例子!