fixed viewFile() for html documents