Home  >  Q&A  >  body text

javascript - bootstrap fileinput uploads files with Chinese file names, and the file names only show the suffix

Version: bootstrap fileinput version 4.1.8
As shown in the picture:

Select the file 2.xlsx for non-resident users, it becomes 2.xlsx, and the Chinese is lost

How to solve it

oFile.Init = function(ctrlName, uploadUrl) {

            var control = $('#' + ctrlName);
             
            //初始化上传控件的样式
            control.fileinput({
                language: 'zh', //设置语言
                uploadUrl: uploadUrl, //上传的地址
                allowedFileExtensions: ['xlsx'],
                showUpload: true, //是否显示上传按钮
                showCaption: false,//是否显示标题
                browseClass: "btn btn-primary", //按钮样式 
                dropZoneEnabled: false,//是否显示拖拽区域
                
                maxFileCount: 1, //表示允许同时上传的最大文件个数
                enctype: 'multipart/form-data',
                validateInitialCount:true,
                previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
                msgFilesTooMany: "选择上传的文件数量({n}) 超过允许的最大数值{m}!",
                uploadExtraData: function() {
                    return {"imageFileName":fodderType()};
               }
            });
我想大声告诉你我想大声告诉你2712 days ago1124

reply all(1)I'll reply

  • 黄舟

    黄舟2017-05-18 10:53:10

    Master, I am in the same situation as you. How did you solve it in the end

    reply
    0
  • Cancelreply