一个非常简的多文件上传例子.docVIP

  • 4
  • 0
  • 约3.6千字
  • 约 4页
  • 2016-12-03 发布于贵州
  • 举报
一个非常简的多文件上传例子

简单的多文件上传 Action部分: package com.jb.action; import java.io.File; import mons.io.FileUtils; import org.apache.struts2.ServletActionContext; import com.opensymphony.xwork2.ActionContext; public class UploadAction { private File[] image;//对应页面上File文件的name属性值 private String[] imageFileName;//文件的名字 定义格式为xxFilename private String[] imageContentType;//上传文件类型,定义格式为xxContentType public String uploadImage() throws Exception { String realPath = ServletActionContext.getServletContext().getRealPath( /image); System.out.println(realPath); if (image != null) { for (int i = 0; i ima

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档