Do not store files in a database. Everyone, without exception, that can run any RDBMS on the market already has a database specifically for storing files, and the RDBMS itself is using it! That database is the filesystem. No filehandes to files in the database. With the exception of PostgreSQL...