zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

(Feature request) Add the ability to attach binary (any) files to notes #2592

Closed dreamofi closed 2 years ago

dreamofi commented 2 years ago

Describe feature

It would be great if Trilium allow attaching files in a note. For example, I want to store some pdf and excels file in the note (just for storing instead of rendering, like Microsoft Word allow adding files to the docx file).

Additional Information

No response

zadam commented 2 years ago

This is supported:

image

The binary files will be stored as child notes underneath the current note.

Drag & drop should work too.

dreamofi commented 2 years ago

Thank you! I've tried it just now and it works wonderfully. I'll close this ticket :)

cwilliams5 commented 2 years ago

Hey Zadam,

These would inflate the db pretty big right? Is there performance reasons or anything to stay away from doing that or is OK to just go nuts with attachments.

zadam commented 2 years ago

Performance should be generally fine, SQLite can easily handle tens of gigabytes. There might be problems with very big attachments since Trilium needs to load them into memory, files under 100 MBs should be fine.

With the growing DB size one problem I can think of could be automatic backup which creates a copy of the DB before application starts and this can take some time (depends on disk speed). Backup can be turned off.