MiME upload help
Posted: Thu Sep 18, 2008 4:07 am
Hi,
I need to be able to allow a Word document and a pdf only to be uploaded and was trying to use the code below. However this is simply not uploading at all. This is what I was using.
If I simply use this
….then this will allow me to upload a Word doc or PDF (if I change 'application/msword' msword' to 'application/pdf using them individually’) but I can’t get the script to run with both together using an array.
Any ideas?
Thanks
I need to be able to allow a Word document and a pdf only to be uploaded and was trying to use the code below. However this is simply not uploading at all. This is what I was using.
Code: Select all
<?PHP
$FILE_MIMES = array('application/msword','application/pdf');
if (isset($_FILES['fupload'])){
if ($_FILES['fupload']['type'] == '$FILE_MIMES' ) { // etc ?>Code: Select all
<?PHP
if (isset($_FILES['fupload'])){
if ($_FILES['fupload']['type'] == 'application/msword' ) { // etc ?>Any ideas?
Thanks