How to ensure that uploaded file is video or picture?

Posted by Kirzilla on Stack Overflow See other posts from Stack Overflow or by Kirzilla
Published on 2010-04-10T08:10:24Z Indexed on 2010/04/10 8:13 UTC
Read the original article Hit count: 303

Filed under:

Hello,

I want to be sure that user uploaded files are real videos or pictures, but not just a piece of text renamed to textfile.jpg. What are the ways to ensure?

I see the only way: detect type of file by it's extension and then, depending on file type, try to get information about it (by Imagemagick or ffmpeg).

Is there any other ways?

Thank you.

© Stack Overflow or respective owner

Related posts about media