auto file type detection