Jump to content

[SOLVED] I can upload images in FF but not IE6 or IE7? WHY???


cooldude832

Recommended Posts

My jpg uploader is flawless in FF and fails out in IE6/7 anyone got some ideas

 

if ($_POST['newimages'] == "yes")
{
while ($i <= 3)
{

if ($HTTP_POST_FILES['imagefile'.$i]['type'] == "image/jpeg" || $HTTP_POST_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++;
}
}

 

the form is:

<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 />

What does the submit button look like in your code?

 

If you put

<?php
echo '<pre>' . print_r($_POST,true) . '</pre>';
echo '<pre>' . print_r($_FILE,true) . '</pre>';
?>

at the beginning of the processing script, what gets shown on the screen?

 

Ken

Problem solved:

if ($HTTP_POST_FILES['imagefile'.$i]['type'] == "image/jpeg" || $HTTP_POST_FILES['imagefile'.$i]['type'] == "image/jpg")

After

if ($HTTP_POST_FILES['imagefile'.$i]['type'] == "image/jpeg" || $HTTP_POST_FILES['imagefile'.$i]['type'] == "image/jpg"
	 || $HTTP_POST_FILES['imagefile'.$i]['type'] == "image/pjpeg")

 

Apparently IE uses the MIME types thus i needeed pjpeg

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.