您的位置:首页 > Web前端 > BootStrap

bootstrap-fileinput 文件上传

2019-08-12 14:35 1631 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。 本文链接:https://blog.csdn.net/weixin_43853787/article/details/99301234

$("#fileupload_input_factor").fileinput({
        language : 'zh',
        uploadUrl : contextpath + "/rest/pollutionburining/burninguploadfile?status="+status+"&source="+source,
        enctype : 'multipart/form-data',
        // 隐藏文件预览缩略图
        showPreview : false,
        // 隐藏上传按钮
        showUpload : true,
        // 显示标题
        showCaption : true,
        // 预加载说明
        initialCaption : "上传贡献文件",
        // 只能选择{text类型}
        allowedPreviewTypes : [ 'txt'],
        // 只能上传一下类型文件
        allowedFileExtensions : [ "txt"],
        // 报错样式
        previewClass : "bg-warning",
        maxFileSize : 2000,        
        window:true,
    });
    // 上传回调
    $("#fileupload_input_factor").on("fileuploaded", function(event, data, previewId, index) {
            if(data.response.message=="数据重复!"||data.response.message=="文件上传失败!"){
                MyAlert(data.response.message,function(){
                    $roadpm11.find("#pollution-table").bootstrapTable('refresh');
                })
            }else{
                setTimeout(function(){
                    $roadpm11.find("#pollution-table").bootstrapTable('refresh');
                },5000);
            }
    });

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: