upload.html
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
My JSP 'Upload_form.jsp' starting page
upload.jsp
<%
//准备上传文件
smart.initialize(pageContext);
//准备上传
smart.upload();
//保存
smart.save("/upload");
String name = smart.getRequest().getParameter("user") ;
String pic = smart.getFiles().getFile(0).getFileName(); //得到上传文件的名称
out.println(name);
out.println(pic);
//out.println("");
%>
阅读(4775) | 评论(4) | 转发(0) |