locally uploads a file to the db