Jump to content

Image Uploading Errors with IE


cooldude832

Recommended Posts

I'm trying to make a image uploader and it works perfect in FF2, but not IE6

This is the snippets involved with it:

 

<form name='ad' action='ad_preview.php' method='post' enctype='multipart/form-data'>
<input type='hidden' name='newimages' value='yes'>
<input type="file" name="imagefile0"> 
<br />
<input type="file" name="imagefile1"> 
<br />
<input type="file" name="imagefile2">
<br />
<input type="file" name="imagefile3">
<br />

Now the Processor Code:

$i = 0;
$count = 0;
//Lets add some nubmers for safety
$random_digit = $_POST['random'];

$us = "_";
$pathto = "/files/".$random_digit.$us;
if ($_POST['newimages'] == "yes")
{
while ($i <= 3)
{

if ($_FILES['imagefile'.$i]['type'] == "image/jpeg" || $_FILES['imagefile'.$i]['type'] == "image/jpg")
	{
	$count++;
	$file_name = "";
	$file_name .= "temp.";
	$file_name .= str_replace(".jpg","",str_replace("/","",str_replace("image","",$HTTP_POST_FILES['imagefile'.$i]['type'])));

	$ext = ".jpg";
	//Lets make a new name
	$new_file_name=$random_digit.$us.$count.$ext;
	//Lets Path it
	$path[$count]= "files/".$new_file_name;
	if(copy($HTTP_POST_FILES['imagefile'.$i]['tmp_name'], $path[$count]))
	{}

}
$i++;
}
}

 

 

Like i said logically the PHP is perfect in FF2, not IE6,7

Link to comment
https://forums.phpfreaks.com/topic/51716-image-uploading-errors-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.