Detect file