LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-08-2005, 07:55 PM   #1
dtra
Member
 
Registered: Nov 2004
Distribution: fc4
Posts: 104

Rep: Reputation: 15
apache/php video mime types


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

Last edited by dtra; 08-08-2005 at 09:53 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cups, mime.types and mr.wobble Linux - Networking 2 05-29-2006 11:44 PM
how to set mime-types? gaah Linux - Newbie 1 10-15-2005 11:23 PM
mime types Nightfrost Linux - General 2 10-01-2004 06:11 AM
Gnome 1.4 and mime types kly546 Debian 0 07-25-2003 03:04 AM
MIME Types? JoeLinux Linux - Software 6 09-14-2002 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration