Examples of SmartUpload


Examples of com.firefun.FileUpload.SmartUpload

     * Handles POST requests
     */
    protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
    {

        SmartUpload mySmartUpload = new SmartUpload();
        //String ccmc = request.getParameter("ccmc");
        //String contenttype = request.getParameter("contenttype");
        //String filemc = request.getParameter("filemc");
        String downid = request.getParameter("downid");
        Result rst = new Result("ffdb");
    String sql = "select * from ff_upload where fileid ='" + downid + "'";
    rst.EQuery(sql);
    String ccmc = rst.getString(0,"ccmc");
        String contenttype = rst.getString(0,"contenttype");
        String filemc = rst.getString(0,"filemc");
   
        String path = Address.getAddress().replace("WEB-INF","")+ "upload/" + ccmc;
        FileUtil util = new FileUtil();
        //System.out.println("%%%%%%%%%%"+util.uploadmodel);
        try
        {
          if(util.uploadmodel.equals("2")){
            util.download(downid, path);
          }
            // Initialization
            mySmartUpload.initialize(config,request,response);
           
            mySmartUpload.setContentDisposition(null);
            mySmartUpload.downloadFile("/upload/"+ccmc,contenttype,filemc)
        }
        catch(Exception e)
        {
          e.printStackTrace();
        }
View Full Code Here

Examples of com.firefun.FileUpload.SmartUpload

      response.sendRedirect(url);
      System.out.println("未接收到ywid:::::::::::::文件上传部分");
    } else{
      Files files_temp = new Files();

      SmartUpload mySmartUpload = new SmartUpload();

      try {
        // Initialization
        mySmartUpload.initialize(config, request, response);

        // Upload
        mySmartUpload.upload();
        Files files = mySmartUpload.getFiles();
       
        //FileUtil fileutil = new FileUtil();
        //fileutil.upload(request, files, ywid, sslx);
        //System.out.println(files.getCount());
        //
View Full Code Here

Examples of com.jspsmart.upload.SmartUpload

  protected void doGet(HttpServletRequest request,
      HttpServletResponse response) throws ServletException, IOException {
    String temp_p = request.getParameter("downloadFileName");
    byte[] temp_t = temp_p.getBytes("UTF-8");
    String fileName = new String(temp_t, "UTF-8");
    SmartUpload mySmartUpload = new SmartUpload();
    try {
      // 初始化
      mySmartUpload.initialize(config, request, response);
      // 设置不自动打开
      mySmartUpload.setContentDisposition(null);
      mySmartUpload.downloadFile("/upload/" + fileName);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of com.jspsmart.upload.SmartUpload

    out.println("<H1>jspSmartUpload : Servlet Sample</H1>");
    out.println("<HR>");
    // 变量定义
    int count = 0;
    // 创建一个SmartUpload类
    SmartUpload mySmartUpload = new SmartUpload();
    try {
      // 初始化
      mySmartUpload.initialize(config, request, response);
      // 上传
      mySmartUpload.upload();
      for (int i = 0; i < mySmartUpload.getFiles().getCount(); i++) {
        com.jspsmart.upload.File myfile = mySmartUpload.getFiles()
            .getFile(i);
        String fileName = myfile.getFileName();
        // 保存
        count = mySmartUpload.save("/upload");
        // count = mySmartUpload.save(null);
      }
      out.println(count + " file uploaded.");
    } catch (Exception e) {
      out.println("Unable to upload the file.<br>");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.