Jump to content

[SOLVED] Image upload problem with IE


SkyRanger

Recommended Posts

I am currently working on a image upload script with some help from a couple of the members here that I greatly appreciate in fixing some of my problems.  Well I found another BIG problem.  I can upload no problem with FF but when tested on IE it will not upload.  I am not sure what the problem is.

 

Here is the current code:

 

<form name="form1" method="post" action="" enctype="multipart/form-data">
		<input name="desc" type="text" value="DO NOT USE YET" size="30" />
<input type="file" name="imagefile">
<br>
<input type="submit" name="submit" value="Submit"> 
<?
if(isset( $submit ))
{
//If the Submitbutton was pressed do:

if (is_image($_FILES['imagefile']['type']) == TRUE){ 
copy ($_FILES['imagefile']['tmp_name'], "files/images/".$_FILES['imagefile']['name'])

    or die ("Could not copy"); 
echo "<br>"; 
    
	$uploaddate = date("l F j, Y"); 
	$filename = $_FILES['imagefile']['name'];
	$owner = $logged;

	include "inc/dbinfo.inc.php";
// database connect script.
$connection=mysql_connect ("$dblocation", "$dbusername", "$dbpassword") or die ('I cannot connect to the database because: ' . mysql_error());
        mysql_select_db ("$dbname");

$sql = "INSERT INTO memberimages VALUES ('', '".$filename."', '".$owner."', '".$desc."', '".$uploaddate."')";
$result = mysql_query($sql) or die ('I could not add information to the database because ' . mysql_error());

		    
        echo "Name: ".$_FILES['imagefile']['name']."<br>"; 
        echo "Size: ".$_FILES['imagefile']['size']."<br>"; 
        echo "Type: ".$_FILES['imagefile']['type']."<br>"; 
        echo "Image Upload Completed"; 
        } 
	else {
            echo "<br><br>";
            echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")<br>";
        }
} 
?></form>	

 

The above code works perfectly in Firefox but will not in IE.  The only thing that echos after submit is: image/jpg and that is it.

Link to comment
https://forums.phpfreaks.com/topic/48858-solved-image-upload-problem-with-ie/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.