hi all
we are making a form for users to upload media content to our site
just a quick question, users will probably be able to upload any video content (not streaming)
we need to make sure that the file we are uploading is compatible, so either jpeg, or video not streaming
is there a common regex that i can use for this
i know we can use something like
PHP Code:
preg_match('#^image/jpeg#', $uploadedfile['file']['type']);
for jpeg's
can i use something like
PHP Code:
preg_match('#^(video/)+([\w\-])#', $uploadedfile['file']['type']);
for video's
most common videos would be what we were looking at
usually something from a phone/camera, cos these will be very short videos, definitely smaller than 2MB
.avi, .wmv, .mpg, mp4, 3gp, .mov, there are prolly more, so if someone can think ahead for me
and we may be looking to add audio as well, so would that be like
PHP Code:
preg_match('#^(audio/)+([\w\-])#', $uploadedfile['file']['type']);
and would i need to add each mime type to the httpd.conf for this to work properly, eg. add one AddType for each mimetype that we expect to be used?
actually i've been doing some testing and all the mime types appear to be there, does anyone know where i can find the file with the list of mime types?
thanks
dave