Fixed file handling on the front end. Now getting database errors.