This needs quite fast fixing. Works fine in FF but echos negative when using IE saying that only .jpg files are allowed. Anyway i use 2 php files to upload files into directories: 1st - uploading.php <html><title>Faili laadimine</title> <body> <?php require_once "../../maincore.php"; ?> <?php if (iMEMBER) { echo "<form enctype='multipart/form-data' action='upload.php' method='post'>"; echo "<input type='hidden' name='MAX_FILE_SIZE' value='1000000' />"; echo "Vali pilt (jpg): "; echo "<input name='uploaded_file' type='file' />"; echo "<input type='submit' value='Saada' />"; echo "</form>"; }else{ echo "<img src='".BASEDIR."images/main/negative.png'> Mängude üleslaadimiseks logi sisse.";} ?> </body> </html> Code (markup): 2nd - upload.php <?php require_once "../../maincore.php"; //Сheck that we have a file if((!empty($_FILES["uploaded_file"])) && ($_FILES['uploaded_file']['error'] == 0)) { //Check if the file is JPEG image and it's size is less than 100Kb $filename = basename($_FILES['uploaded_file']['name']); $ext = substr($filename, strrpos($filename, '.') + 1); if (($ext == "jpg") && ($_FILES["uploaded_file"]["type"] == "image/jpeg") && ($_FILES["uploaded_file"]["size"] < 100000)) { //Determine the path to which we want to save this file $newname = dirname(__FILE__).'/files/'.$filename; //Check if the file with the same name is already exists on the server if (!file_exists($newname)) { //Attempt to move the uploaded file to it's new place if ((move_uploaded_file($_FILES['uploaded_file']['tmp_name'],$newname))) { echo "<img src='".BASEDIR."images/main/positive.png'> Pilt on edukalt saadetud!"; } } else { echo "<img src='".BASEDIR."images/main/negative.png'> Antud failinimi ".$_FILES["uploaded_file"]["name"]." on juba kasutusel!"; } } else { echo "<img src='".BASEDIR."images/main/negative.png'> Ainult .jpg formaadis pildid maksimaalse suurusega 100kb!"; } } else { echo "<img src='".BASEDIR."images/main/negative.png'> Faili ei saadetud!"; } ?> Code (markup): UPLOAD.PHP contains code to generate form. UPLOADING.PHP system file for upload.php: file checking, size checking, general upload code etc.
If I do remember correctly IE creates it's own MIME type for jpg pictures.. (image/pjpeg or something similar). Try to print_r the $_FILES array to see what it actually is.
^ Yep, that's the problem. And you should not rely on the MIME type of the $_FILES array anyway, because it comes from the user's browser and can be easily faked.