I'm using the following code to upload images using PHP 4.2.3 on WIndows XP Pro with IIS. I'm not getting any errors and the file is not uploading.
ANy ideas?
<?php
//check to see if the user has logged in
$session = new Session();
$sid= $session->get('sid');
if ($session->get('isLoggedIn')== false){
// Send them to the login page.
header('location: index.php?errorCode=AccessDenied');
}else{
if (!isset($_POST['uploadOk'])){
?>
<form method = "POST" enctype="multipart/form-data" action="<?php echo $PHP_SELF;?>?module=Admin&page=ImageUpload&sid=<?php echo strip_tags($sid);?>">
Local Filename <input type="file" name="form_image">
<input type="submit" name="uploadOk" value="Upload">
</form>
<?php
}else{
if(is_uploaded_file($_FILES['form_image']['tmp_name']))
{
// file uploaded to server
echo "file information is :-<br />";
print_r($_FILES);
$imageInfo = getimagesize($_FILES['form_image']['tmp_name']);
$img_dir = "D:\\webdev\\TFN\\images\\";
$width = $imageInfo[0];
$height = $imageInfo[1];
$image_type = $imageInfo[2];
print_r($imageInfo );
move_uploaded_file($_FILES['form_image']['name'],$img_dir."/".$_FILES['form_image']['name']);
}
else
{
// file not uploaded to server
}
} //end if isset
} // end if
?>
I checked my php.ini and file_uploads is on and upload_tmp_dir is set to c:\temp. Folder permissions are fine as well; simple sharing has been disabled.
I did check other threads, but could not find an answer.
Thanks.