Openning Blob Data stored in Sqlite as a File with Tcl/Tk
- by dmullins
Hello:
I am using the following tcl code to store a file from my deskstop into a Sqlite database as blob data ($fileText is a path to a text file):
sqlite3 db Docs.db
set fileID [open $fileText RDONLY]
fconfigure $fileID -translation binary
set content [read $fileID]
close $fileID
db eval {insert into Document (Doc) VALUES ($content)}
db close
I have found many resources on how to open the blob data to read and write to it, but I cannot find any resources on openning the blob data as a file. For example, if $fileText was a pdf, how would I open it, from Sqlite, as a pdf?
Thanks,
DFM