Detect file types