Database file upload / download
db_upload_file() stores a file in a database table. Make sure that the column data type is big enough for the files you will be storing. db_download_file() retrieves a file from the database and places it in the same path as the script calling it, and returns the relative URL. If the file does not exist in the database, it returns an empty string.