Testing file upload to / download from database


I need to test that a file got successfully saved to our database, and then that it got successfully downloaded. I’ve found some snippets on the upload side, but nothing on how to test that a file stored in the database get’s successfully delivered to the user.

Anybody know of anything, or got any ideas about how best to go about this? I’m having some trouble getting my arms around it conceptually.