adding files now works

files are written in the database. Tags and category as well