e90953726f9882500b223611238683383cbf0a04.svn-base 715 B

1234567891011121314151617
  1. <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
  2. <%@ page import="com.qui.base.Uploader" %>
  3. <%
  4. request.setCharacterEncoding("utf-8");
  5. response.setCharacterEncoding("utf-8");
  6. Uploader up = new Uploader(request);
  7. up.setSavePath("upload"); //保存路径
  8. String[] fileType = {".rar" , ".doc" , ".docx" , ".zip" , ".pdf" , ".txt" , ".swf", ".wmv"}; //允许的文件类型
  9. up.setAllowFiles(fileType);
  10. up.setMaxSize(10000); //允许的文件最大尺寸,单位KB
  11. up.upload();
  12. response.getWriter().print("{'url':'"+up.getUrl()+"','fileType':'"+up.getType()+"','state':'"+up.getState()+"','original':'"+up.getOriginalName()+"'}");
  13. %>