Home > Blockchain >  How to store files in sqlite3 database
How to store files in sqlite3 database

Time:08-03

is there a way to store .txt or .pdf files within a table of my sqlite3 database?

CodePudding user response:

yes is possible to store file in sqlite you can see this link to find how to store file

but I suggest you to don't do that because if you store some file in database, it's become too Heavy and slow to get query

the manageable situation is your save file in file manager and store file location address in database

CodePudding user response:

Yes, you can store file in database in 2 ways

  1. Store as binary or blobs
  2. Store file in physical and path only store in database.

But both got some disadvantages.

If binary or blobs , database get heavy and make slow performance in query.

if file path only in database, when u backup and restore database in another place, then need to move physical file also and also anybody delete file from physical folder directly.

Is your requirements is small , then got with binary.let choose yourself.

  • Related