Skip to content

Build your personal knowledge base with Trilium Notes

adding file length limit to tar export

zadam295af1f43e52
diff --git a/src/services/export/tar.js b/src/services/export/tar.js
index 441f62d9db..7af704f2d4 100644
--- a/src/services/export/tar.js
+++ b/src/services/export/tar.js
@@ -84,7 +84,12 @@ async function exportToTar(taskContext, branch, format, res) {
}
const completeTitle = branch.prefix ? (branch.prefix + ' - ' + note.title) : note.title;
- const baseFileName = sanitize(completeTitle);
+ let baseFileName = sanitize(completeTitle);
+
+ if (baseFileName.length > 200) { // actual limit is 256 bytes(!) but let's be conservative
+ baseFileName = baseFileName.substr(0, 200);
+ }
+
const notePath = parentMeta.notePath.concat([note.noteId]);
if (note.noteId in noteIdToMeta) {