Re: upload file

From: Date: Sun, 04 Mar 2007 22:15:38 +0000
Subject: Re: upload file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-249833@lists.php.net to get a copy of this message
$permissable_MINE_types= array( //*** file upload parms 'image/png' => 'png', 'image/gif' => 'gif', 'image/jpeg' => 'jpg', 'image/pjpeg' => 'jpg', 'application/pdf' => 'pdf', ); $upload_parms['permis_types']= $permissable_MINE_types; $uptype= $_FILES['userfile']['type']; if(!array_key_exists($uptype, $upload_parms['permis_types'])) {
        $report .= "
<p style=\"color:red\">Uploaded file wrong file type, is $uptype.</p>\n";
        $error = TRUE;
    }
Alain Roger wrote:
Hi, I would like in fact to make more precise my previous post. I would like in fact to restrict the file extension (and therefore the user possibility). My user should be able only to upload files with extension JPEG, BMP, GIF. How can i set those parameter ? thx.


« previous php.general (#249833) next »