Fixed databse reference issue, added file upload tests.