Add file upload and write to database