How To…Save/Load Archives from a Database

Question

“How do I save/load archive files to and from a table in my database?”

Solution

To save a file to DB, export the archive to memory stream using the TppStreamDevice.OutputStream property, then copy that to a TBlobStream which can easily be saved to a DB.
If the archives are already saved to file, create a TFileStream and use the same technique.

Loading archives from a database can easily be done using the TppDBArchiveReader object available from the Delphi component pallet.

Download: DBArchiveReader.zip

Sample Delphi code: