Upload Problem II
Posted: Sun Jun 27, 2004 2:06 pm
I am having a bit of a problem with my upload code. Everytime I try to upload a file all I get is an error. What I am trying to create is an array with the file extensions which are allowed to be passed to the server. The code works great when I take this array out so I know it has something to do with it. The code for my array go's like:
$array = array("application/vnd.ms-excel", "application/msword", "application/zip", "application/rtf");
if (!in_array($_FILES['imagefile']['type'], $array))
{
echo "An unexpected error has occured. Please view the <A href='help.php'>help file</A> for more information!";
exit;
}
I tried uploading .zip and .rtf with no luck. Any help appreciated!
Joe
$array = array("application/vnd.ms-excel", "application/msword", "application/zip", "application/rtf");
if (!in_array($_FILES['imagefile']['type'], $array))
{
echo "An unexpected error has occured. Please view the <A href='help.php'>help file</A> for more information!";
exit;
}
I tried uploading .zip and .rtf with no luck. Any help appreciated!
Joe