|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
I have a php upload module that I have used for a while that has been doing a great job of uploading jpgs, pdfs, txt, mov files etc.
Now I want to upload .wmv files, but the browser doesn't seem to pass my file type to php. If I upload a jpeg file and say: echo $userfile_type; it returns "image/jpg" If I upload a wmv file and say: echo $userfile_type; it returns "" it should return "video/x-ms-wmv" Anybody have any thoughts on this matter? |
|
#2
|
||||
|
||||
|
Maybe the mime-type doesn't exist on your server. If you're on a *NIX box, check out /etc/mime.types and look around for this mime-type. If it doesn't exist, add it. This could also break depending on how your script figures out what file type it is. If it uses the system call to "file," for example, and wmv isn't defined in the various things that call checks, then you'll need to get it added (I'm not sure how). You could also add some code that checks based on file extension, though that's not so safe -- anybody can rename something before they upload it and put something nasty on your system.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > php file upload problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|