Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.