package night;
import java.io.FileOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;
public class UpLoadAction extends Action
{
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
{
UpLoadActionForm myForm = (UpLoadActionForm) form;
FormFile file = myForm.getMyFile();
FileOutputStream out = new FileOutputStream("e:\\" + file.getFileName());
out.write(file.getFileData());
out.flush();
out.close();
return mapping.findForward("success");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Struts_upLoad.rar (38个子文件)
.project 1KB
.settings
.jsdtscope 454B
org.eclipse.wst.common.component 432B
org.eclipse.jdt.core.prefs 330B
org.eclipse.wst.common.project.facet.core.xml 320B
org.eclipse.jst.common.project.facet.core.prefs 364B
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.jsdt.ui.superType.name 6B
src
night
UpLoadActionForm.java 534B
UpLoadAction.java 952B
build
classes
night
UpLoadActionForm.class 861B
UpLoadAction.class 2KB
WebContent
success.jsp 376B
WEB-INF
web.xml 916B
struts-config.xml 724B
lib
struts-taglib-1.3.8.jar 246KB
struts-faces-1.3.8.jar 92KB
bsf-2.3.0.jar 171KB
commons-chain-1.1.jar 88KB
commons-logging-1.0.4.jar 37KB
oro-2.0.8.jar 64KB
struts-mailreader-dao-1.3.8.jar 19KB
struts-scripting-1.3.8.jar 17KB
commons-digester-1.8.jar 140KB
commons-beanutils-1.7.0.jar 184KB
struts-extras-1.3.8.jar 39KB
struts-core-1.3.8.jar 321KB
struts-el-1.3.8.jar 258KB
commons-io-1.1.jar 60KB
standard-1.0.2.jar 504KB
struts-tiles-1.3.8.jar 117KB
jstl-1.0.2.jar 20KB
antlr-2.7.2.jar 350KB
commons-validator-1.3.1.jar 136KB
commons-fileupload-1.1.1.jar 31KB
upload.jsp 805B
META-INF
MANIFEST.MF 39B
.classpath 618B
共 38 条
- 1
资源评论
- owefovi2014-04-21运行不了的
- liumengyu2010102012-05-22试了一下,挺好的。谢了
Star_of_Java
- 粉丝: 13
- 资源: 137
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功