某些页面被读取后出现错误
“ pdf.js:25744未捕获的DOMException:无法在'DedicatedWorkerGlobalScope'上执行'postMessage':无法克隆数据,内存不足。”
仅当我使用2 MB以上的文件时,这种情况才会发生。
如何在pdf.js文件中更改最大允许文件?
MessageHandler.prototype = {
on: function messageHandlerOn(actionName, handler, scope) {
var ah = this.actionHandler;
if (ah[actionName]) {
throw 'There is already an actionName called "' + actionName + '"';
}
ah[actionName] = [handler, scope];
},
send: function messageHandlerSend(actionName, data) {
this.comObj.postMessage({ //console is showing error in this line
action: actionName,
data: data
});
}
};
答案 0 :(得分:0)
尝试在您的php.ini文件中增加upload_max_filesize和post_max_size(通常您会找到2M)
答案 1 :(得分:0)
增加post_max_size
和upload_max_filesize
。您可以在php.ini
中设置2个不同的位置,因为upload_max_filesize
的默认PHP值为2 MB,post_max_size
的默认PHP值为8 MB。
; Maximum allowed size for uploaded files.
upload_max_filesize = 20M
; Must be greater than or equal to upload_max_filesize
post_max_size = 20M
此更改需要重新启动服务器