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
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.