trouble uploading a mht file

See all posts See thread Reply

Re: trouble uploading a mht file new!
by ric woods, 15 years, 2 months ago
thanks Colin, it worked great
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
$uploaded->allowed[] = mime_content_type($uploaded->file_src_pathname);
but it did not work

Sorry I am relatively new to php and MIME.

Thanks

RicReply
Re: trouble uploading a mht file new!
by colin, 15 years, 2 months ago
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