RE: [PHP-DB] Restricting mime type in file uploads?

From: Date: Wed, 07 Aug 2002 07:25:26 +0000
Subject: RE: [PHP-DB] Restricting mime type in file uploads?
Groups: php.db 
Request: Send a blank email to php-db+get-21035@lists.php.net to get a copy of this message
Dave, when you upload the file, you should have access to something like $_FILES['filename']['type'] which will give you the mimetype for the file uploaded - jpeg is (i think - someone correct me?) image/jpeg OR image/jpg so you can just check it, then throw an error if it doesn't equal the right type (does mean that you have to upload it, then kill it if it doesn't suit) HTH Beau // -----Original Message----- // From: Dave Carrera [mailto:dave@davecarrera.com] // Sent: Wednesday, 7 August 2002 3:20 PM // To: php-db@lists.php.net // Subject: [PHP-DB] Restricting mime type in file uploads? // // // Hi All // I have a working ap to allow clients to upload their images // to a server // & then I write the path to a MySql db for retrieval later. // But I have been asked if we can control the mime type to only accept // JPG's and nothing else. // // I can't seem to find the answer anywhere so I humbly ask for // your help // or guidance. // // Thank you in advance // // Dave C //

« previous php.db (#21035) next »