ueditor 单独上传1G以上大文件

一、单独上传附件

1、html代码

   <script id="ue_target">

    </script>
    <input type="text" id="_file" name="files" /><a href="#"  onclick="up_file();">附件...</a>

2、jquery代码

  

 var ue_file = UE.getEditor("ue_target", {
        initialFrameWidth: 600,
        initialFrameHeight: 400,
    });
    ue_file.ready(function () {
        //设置编辑器不可用
        ue_file.setDisabled();
        //隐藏编辑器
        ue_file.hide();
       
        //文件上传成功事件(你点击确定按钮触发)
        ue_file.addListener('afterUpfile', function (_k, _arg) {
            $("#_file").attr("value", ue_file.options.filePath + _arg[0].url);
        })
    });
    //文件上传的对话框
    function up_file() {
        var file_dialog = _editor.getDialog("attachment");
        file_dialog.open();
    }

3、绑定afterUpfile事件、打开ueditor-->dialog-->attachment-->attachment.js

4、加上下面这行代码

5、上传文件对话框鼠标点击会关闭、我这边想去掉这个、注释掉,在uditor.all.js中

 6、去掉对话框关闭按钮,在ueditor.all.js中

二、上传大文件

1、设置ueditor后端文件最大长度、我用的是.net打开config.json文件

2、修改fileMaxSize,我默认2G,这里只是后端检查文件大小

3、修改ueditor的web.config配置文件,这里是网站能请求的最大长度

4、修改httpRuntime节点、maxRequestLength属性

 5、如果不行修改网站的web.config

6、修改文件保存路径

1)、修改配置文件

2)、修改后端代码

7、再不行修改IIS

1)、打开IIS

2)、修改请求限制

原文地址:https://www.cnblogs.com/study10000/p/10565468.html