class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
No, you cannot do what you did, as file_src_pathname is set after allowed is read.
For security reason, MIME types are limited to what you allow only. So you have an array of allowed MIME types in allowed, and you can add some as you did with message/rfc822.
You can allow everything, but it is dangerous, so I wouldn't recommend it. To allow everything, use:
$uploaded->allowed = array('*/*');
You can then later add some dangerous MIME types in forbidden to explicitly prevent your users to upload some dangerous files.Reply
but, as usual another question
the site this is for will be updated by non-technical staff.
Is there a way the MIME type can be automatically determined?
i tried
but it did not work
Sorry I am relatively new to php and MIME.
Thanks
Ric
For security reason, MIME types are limited to what you allow only. So you have an array of allowed MIME types in allowed, and you can add some as you did with message/rfc822.
You can allow everything, but it is dangerous, so I wouldn't recommend it. To allow everything, use:
You can then later add some dangerous MIME types in forbidden to explicitly prevent your users to upload some dangerous files.