fix #3823: detect import file type by content