How to upload files into database using Free Pascal/Lazarus

To upload files into database, such as photos or any other files type, you need first to create a Blob field in a proper table structure in your favourite database engine. For this example we are using FireBird database table: Create a new Lazarus application and add the following components: TButton, TIBConnection, TSQLTransaction, TSQLQuery, and TOpenDialog:…

How to copy files in Free Pascal

To copy files in Free Pascal, you can do it in many ways, one of them is to use TStreamFile‘s CopyFrom method. This example could copy any type of files without changing it’s contents. But destination file information will be changed, like file name, and updated time.