Web大文件上传控件-jsp-sql示例更新-Xproer.HttpUploader6.2

版权所有 2009-2016荆门泽优软件有限公司

保留所有权利

官方网站:http://www.ncmem.com/

产品首页:http://www.ncmem.com/webapp/up6.2/index.asp

在线演示:http://www.ncmem.com/products/up6.2/index.htm

产品介绍:http://www.cnblogs.com/xproer/archive/2012/10/26/2741264.html

升级日志:http://www.cnblogs.com/xproer/archive/2012/10/26/2741268.html

开发文档-ASPhttp://www.cnblogs.com/xproer/archive/2012/02/17/2355458.html

开发文档-PHPhttp://www.cnblogs.com/xproer/archive/2012/02/17/2355467.html

开发文档-JSPhttp://www.cnblogs.com/xproer/archive/2012/02/17/2355462.html

开发文档-ASP.NEThttp://www.cnblogs.com/xproer/archive/2012/02/17/2355469.html

资源下载:cab安装包(x86),cab安装包(x64),crx安装包,crx(nat)安装,xpi安装包,exe安装包,开发文档,VC运行库,Discuz!X2插件下载,

示例下载(.NET)SQL2005示例,

示例下载(JSP)Sql2005示例,MySQL示例,Oracle示例,

示例下载(PHP)MySQL示例

联系信箱:1085617561@qq.com

联系QQ1085617561

 

更新fd_del.jsp

更新前:

dcb59af7-3f6e-4a74-b2f8-e0a7df14648a

更新后:

f48745e9-1470-49b0-9f11-8c7602b2680a

代码:

<%@ page language="java" import="up6.DBFolder" pageEncoding="UTF-8"%><%@

     page contentType="text/html;charset=UTF-8"%><%@

     page import="org.apache.commons.lang.StringUtils" %><%

/*

     此页面主要用来执行删除文件夹逻辑。

     只修改数据库中文件夹状态。

     更新记录:

         2014-07-24 创建

*/

String path = request.getContextPath();

 

String fid    = request.getParameter("fid");

String fdid   = request.getParameter("fd_id");

String uid    = request.getParameter("uid");

String cbk    = request.getParameter("callback");//jsonp

int ret = 0;

 

//参数为空

if ( !StringUtils.isBlank(fid)

     &&   !StringUtils.isBlank(fdid)

     &&   uid.length()>0 )

{

     DBFolder.Remove(Integer.parseInt(fid),Integer.parseInt(fdid), Integer.parseInt(uid));

     ret = 1;

}

out.write(cbk + "({"value":" + ret + "})");

%>

 

更新DBFolder.java

更新前:

81b35c6b-e388-4d2d-aafe-dddb0863a264

更新后:

e66ec45c-c5e2-4f34-9bad-690d2fe2dc7a

代码:

     static public void Remove(int fid,int fdid,int uid)

     {

         StringBuilder sb = new StringBuilder();

         sb.append("update up6_files set f_deleted=1 where f_id=? and f_uid=?;");

         sb.append("update up6_files set f_deleted=1 where f_pidRoot=? and f_uid=?;");

         sb.append("update up6_folders set fd_delete=1 where fd_id=? and fd_uid=?;");

         DbHelper db = new DbHelper();

         PreparedStatement cmd = db.GetCommand(sb.toString());

         try

         {

              cmd.setInt(1, fid);

              cmd.setInt(2, uid);

              cmd.setInt(3, fdid);

              cmd.setInt(4, uid);

              cmd.setInt(5, fdid);

              cmd.setInt(6, uid);

         } catch (SQLException e) {

              // TODO Auto-generated catch block

              e.printStackTrace();

         }

         db.ExecuteNonQuery(cmd);

     }

 

更新up6.js

更新前:

dc74bff9-70f1-4683-b216-38288c40a39c

更新后:

d4faecef-92fa-4617-b73b-f1ab3571e5ff

代码:

        , "RemoveFolder": function (fileSvr)

        {

            var ref = this;

            var idSvr = fileSvr.idSvr;

            var ui = this.filesUiMap[idSvr];

 

            $.ajax({

                type: "GET"

                   , dataType: 'jsonp'

                   , jsonp: "callback" //自定义的jsonp回调函数名称,默认为jQuery自动生成的随机函数名

                   , url: this.Config["UrlFdDel"]

                   , data: { uid: fileSvr.uid, fid: fileSvr.idSvr,fd_id:fileSvr.fdID, time: new Date().getTime() }

                  , success:function (msg){if (msg.value == 1){ui.empty();}}

                  , error: function () { alert("发送删除文件信息失败!"); }

                  , complete: function (req, sta) { req = null; }

            });

        }

原文地址:https://www.cnblogs.com/xproer/p/5784887.html