Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何检查上传的文件是视频格式还是任何其他格式。用户可以上传任何类型的视频文件。
echo mime_content_type($_FILES['Filedata']['tmp_name']);
// Type contains video/mp4,video/avi,video/mpeg,video/mpg etc if(preg_match('/video\/*/',$_FILES['Filedata']['tmp_name'])): echo "THIS IS A VIDEO FILE"; else: echo "NOT A VIDEO FILE"; endif;