#6165: save file fields into a separate table

Added cleanString for cleaning data for DB insertion, transaction rollback on errors, small bugfixes.