implemented uploading files to db