From 7bf098a57c16616780cd6056e733ccc6ef3311af Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Thu, 21 Aug 2025 22:51:40 +0200 Subject: [PATCH] Use binaryType=blob for file transfer. This was the intended behaviour, but the default value changed at some point. This should in principle allow receiving files larger than available RAM. --- static/protocol.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/protocol.js b/static/protocol.js index eff16d0..b206191 100644 --- a/static/protocol.js +++ b/static/protocol.js @@ -1958,6 +1958,11 @@ TransferredFile.prototype.receive = async function() { f.dc.onclose = function(e) { f.cancel('remote peer closed connection'); }; + try { + f.dc.binaryType = 'blob'; + } catch(e) { + console.warn(`binaryType blob: ${e}`); + } f.dc.onmessage = function(e) { f.receiveData(e.data).catch(e => f.cancel(e)); };