File Type not working in Uploaded File

From: Date: Fri, 10 May 2002 16:18:35 +0000
Subject: File Type not working in Uploaded File
Groups: php.general 
Request: Send a blank email to php-general+get-96962@lists.php.net to get a copy of this message
Hi, This is my upload form : <form action="upload.php" method="POST" enctype="multipart/form-data"> <p align="center"><font size="2" face="Verdana"><strong>Please upload your file below:</p> <input type="file" name="file" size="30"> <p><input type="button" name="submit" type="submit"> Upload </form> And this is part of my PHP coding, that handles the Upload. Basically the problem is, that my code is not recognising the File Type! I have specified "image/jpeg" as the file type, but even then it does not upload ANY file at all. In fact it gives the specific error which i have associated when the file type is wrong. ********* $allow_type = "image/jpeg"; $allow_file_type = "1"; $not_correct_file = "<b><font face=\"$font\" size=\"$font_size\" color=\"$font_color\">Sorry, but the file you tried to upload is not valid file to upload!"; if ($allow_file_type == "1") { if ($allow_type != $type) { die("$not_correct_file"); } } ********* Why is it that it is NOT recognising ANY file type. I tried removing the Cheking of FILE type, and the program was working fine, where it was Uploading ANY file. However, as soon as i put in this particular code to check for File Type, it does NOT upload any file. Help! T. Edison Jr. ===== Rahul S. Johari (Director) ****************************************** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : abraxastech@yahoo.com Tel : 91-4546512/4522124 ******************************************* __________________________________________________ Do You Yahoo!? Yahoo! Shopping - Mother's Day is May 12th! http://shopping.yahoo.com

« previous php.general (#96962) next »