diff --git a/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js b/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js index 6a7637d5c..a8dd4114f 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js @@ -107,7 +107,9 @@ SqlTiddlerStore.prototype.processIncomingTiddler = function(tiddlerFields) { if(attachmentSizeLimit < 100 * 1024) { attachmentSizeLimit = 100 * 1024; } - if(tiddlerFields.text && tiddlerFields.text.length > attachmentSizeLimit) { + const contentTypeInfo = $tw.config.contentTypeInfo[tiddlerFields.type || "text/vnd.tiddlywiki"], + isBinary = !!contentTypeInfo && contentTypeInfo.encoding === "base64"; + if(isBinary && tiddlerFields.text && tiddlerFields.text.length > attachmentSizeLimit) { const attachment_blob = this.attachmentStore.saveAttachment({ text: tiddlerFields.text, type: tiddlerFields.type,