Can a dragged PDF be saved to a database

I have a textarea field and I notice that on a Mac I can drag things into it - like JPGs and PDFs.

I notice that when I drag a PDF file, it scrolls just like the original PDF.

Is it possible to save this PDF file in a SQL (postgreSQL) database and then open it later (even, let’s say, with an HTML viewer)? I would just like to store files, not really make changes to it ever.

What exactly is the Mac OS doing that allows a JPG or PDF can be dragged into this textarea?