Javascript XMLHttpRequest只发送最大大小为130 kB的文件

Javascript XMLHttpRequest只发送最大大小为130 kB的文件,javascript,post,xmlhttprequest,Javascript,Post,Xmlhttprequest,我使用XMLHttpRequest发送文件,当文件大小小于130 kB时,它工作正常 我的代码是 var xhr = new XMLHttpRequest(); xhr.upload.onprogress = function(e){ if (e.lengthComputable){ self._loaded[id] = e.loaded; self._options.onProgress(id, name, e.load

我使用XMLHttpRequest发送文件,当文件大小小于130 kB时,它工作正常

我的代码是

var xhr = new XMLHttpRequest();

    xhr.upload.onprogress = function(e){
        if (e.lengthComputable){
            self._loaded[id] = e.loaded;
            self._options.onProgress(id, name, e.loaded, e.total);
        }
    };

    xhr.onreadystatechange = function(){            
        if (xhr.readyState == 4){
            self._onComplete(id, xhr);                    
        }
    };

    // build query string
    params = params || {};
    params['qqfile'] = name;
    var queryString = qq.obj2url(params, this._options.action);

    xhr.open("POST", queryString, true);
    xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
    xhr.setRequestHeader("X-File-Name", encodeURIComponent(name));
    xhr.setRequestHeader("Content-Type", "application/octet-stream");
    xhr.send(file);

有人能帮我吗?

当mod_security(PHP服务器)被禁用时,问题得到了解决。

您在服务器端使用的是什么?例如,PHP对文件上传大小有限制。我正在使用PHP。大小限制现在是32MB。