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.
This commit is contained in:
Juliusz Chroboczek
2025-08-21 22:51:40 +02:00
parent b40dcd2fc8
commit 7bf098a57c
+5
View File
@@ -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));
};