Numerous changes to session and teiler to get the file transfer working.