0

I am uploading images and video from one browse button. On the backend side, I want to identify it's type whether it's video file, image or invalid file.

I checked with

$_FILES['name']['type']

for images it's ok there are 4-5 types of images we need to allow. But, for videos there are lots of types. Like in this case it's application/octet-stream

RNK
  • 5,582
  • 11
  • 65
  • 133
  • http://stackoverflow.com/questions/3074527/how-to-check-whether-file-is-image-or-video-type-in-php-version-5-2-9 – zer02 Feb 14 '14 at 19:09
  • So why not just allow most known formats like .avi, .mp4 . wmv ? There is no need to allow every single codec format. – user2831723 Feb 14 '14 at 19:09
  • in the file array. there is no MIME type key. I never used this thing. I think I need to look into it. – RNK Feb 14 '14 at 19:10
  • @user2831723: actually I am converting anyvideo to mp4 and then store it on server. – RNK Feb 14 '14 at 19:11

0 Answers0