讀取某些頁面后出現(xiàn)錯誤“pdf.js:25744 未捕獲的 DOMException:無法在‘DedicatedWorkerGlobalScope’上執(zhí)行‘postMessage’:數(shù)據(jù)無法克隆,內(nèi)存不足?!眱H當(dāng)我使用大小超過 2 MB 的文件時才會發(fā)生這種情況。如何更改 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 }); }};
2 回答

弒天下
TA貢獻(xiàn)1818條經(jīng)驗 獲得超8個贊
增加post_max_size和upload_max_filesize。您可以在 2 個不同的地方設(shè)置它,php.ini因為 PHP 的默認(rèn)值是 2 MBupload_max_filesize和 8 MB post_max_size。
; Maximum allowed size for uploaded files.
upload_max_filesize = 20M
; Must be greater than or equal to upload_max_filesize
post_max_size = 20M
此更改需要重新啟動服務(wù)器

達(dá)令說
TA貢獻(xiàn)1821條經(jīng)驗 獲得超6個贊
嘗試在你的 php.ini 中增加 upload_max_filesize 和 post_max_size (通常你會發(fā)現(xiàn) 2M)
- 2 回答
- 0 關(guān)注
- 413 瀏覽
添加回答
舉報
0/150
提交
取消