在Mac OS上使用Firefox和Chrome的重音字母

问题描述

我有这个问题: 我有这个标签用于上传文件

<div id="form-attachments">
   <input type="file" name="attachFile" id="attachFile"/>
</div> 

    
                          

我就这样恢复了价值

$("#attachFile").change(function () {
  var file = document.getElementById('attachFile').files[0];
  uploadFile(file);
});

function uploadFile(file) {
    var formData = new FormData();
    formData.append('file',file);
    formData.append('IDNotifica',$('#IDNotifica').val());
    formData.append('relata',$('#fileTipoRelata').val());
    var filename = $('input[type=file]').val().split('\\').pop();
    //var bool = checkNome(filename);
    //if (!bool)
    //    return false;
    $("#loadingFile").fadeIn();
    $.ajax({
        url: $('#PathAggiungiAllegati').val(),//Server script to process data
        type: 'POST',//contentType: "application/json; charset=iso-8859-1",xhr: function () {  // Custom XMLHttpRequest
            var myXhr = $.ajaxSettings.xhr();
            if (myXhr.upload) { // Check if upload property exists
                myXhr.upload.addEventListener('progress',progressHandlingFunction,false); // For handling the progress of the upload
            }
            return myXhr;
        },//Ajax events
        beforeSend: beforeSendHandler,success: completeHandler,error: errorHandler,// Form data
        data: formData,//Options to tell jQuery not to process data or worry about content-type.
        cache: false,contentType: false,processData: false,//beforeSend: function (jqXHR) {
        //    jqXHR.overrideMimeType('application/json;charset=iso-8859-1');
        //}
    });

}

Windows可以,但是在MAC OS中,当上传的文件的值到达服务器时,我有一个检查控件,用于阻止带有特殊字符(也包含字母)的文件,但是此检查不会检测到来自Mac客户端。 我尝试了更多方法(转换为utf8,更改字符集,在客户端ecc处插入检查控件。)但是我认为问题出在标签
中 (此问题仅在Firefox和Chrome上存在,在Safari中可以)

<div id="form-attachments">
     <input type="file" name="attachFile" id="attachFile"/>
</div>`

你能帮我吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)