PHP Classes

Allowed MIME types

Recommend this page to a friend!

      class.upload.php  >  All threads  >  Allowed MIME types  >  (Un) Subscribe thread alerts  
Subject:Allowed MIME types
Summary:Upload procedes regardless to alowed MIME types
Messages:3
Author:Gregor
Date:2006-02-10 20:16:24
Update:2006-05-21 12:13:46
 

  1. Allowed MIME types   Reply   Report abuse  
Picture of Gregor Gregor - 2006-02-10 20:16:24
I've noticed that the upload procedes regardless to the MIME tipe.
I want to allow only images and flash animations like:
$upload = new Upload($datoteka);
$upload->allowed = array( "image/gif",
"image/jpeg",
"image/pjpeg",
"image/png",
"application/x-shockwave-flash");
But it actually accepts any MIME. It accepts any mime type even if I don't override the allowed constant.
Is it a bug a feature missing or am I doing something wrong?
Thanx Greg

  2. Re: Allowed MIME types   Reply   Report abuse  
Picture of Matías montes Matías montes - 2006-02-16 18:09:11 - In reply to message 1 from Gregor
I noticed the same bug a couple of weeks ago but fixed it by adding an extra parameter in the constructor.

The correct way of solving this bug, the same as almost every other validation done by the class is to do the validations (type, size, etc) in the Process method instead of the init method. Unfortunately I realized this a bit to late and my site was already running smoothly. Hopefully there'll be a new release soon when the author takes notice of our comments.



Barbazul

  3. Re: Allowed MIME types   Reply   Report abuse  
Picture of Colin Verot Colin Verot - 2006-05-21 12:13:46 - In reply to message 2 from Matías montes
This bug is now fixed. Thank you.