Jump to content

[SOLVED] Problem uploading files with IE browsers


carlg

Recommended Posts

Is anyone aware of any IE issues that could be causing my problems.  Everything works fine in FireFox.  With IE (6 or 7) it seems like either the form is not getting submitted or there is a problem with the file upload.

 

Here is some of my HTML

 

<div class="piccontrol">
        <div class="pctitle">Photo<?php print " " . $step; ?></div>
        <div class="photo"><img width="400" height="300" src="images/<?php print $filearray[$step]; ?>"></img></div>
        <div class="icontrol">Image File: <input type="file" name="img<?php print $step; ?>"></input></div>
        <div class="icontrol">
        <span><input type="image" src="nj_savephoto.gif" name="save" value="Save Photo<?php print $step;?>"</span> 
        <span><a href="<?php print $_SERVER['PHP_SELF'] . "?action=del" . $step . "&id=" . $id;?>"><img src="deletephoto.gif" border="0"></img></a></span>
        </div>
</div>

 

 

 

Here is the code that includes the above code

 

$step = 1;
        include ("picuploadcontrol.php");
        $step = 2;
        include ("picuploadcontrol.php");
        $step = 3;
        include ("picuploadcontrol.php");
        $step = 4;
        include ("picuploadcontrol.php");
        $step = 5;
        include ("picuploadcontrol.php");
        $step = 6;
        include ("picuploadcontrol.php");

 

 

Here is my code that processes the form input

 

if ($_POST['save']=="Save Photo 1")
        {
                $newname = "images/" . $id . "_1.jpg";
                move_uploaded_file($_FILES['img1']['tmp_name'], $newname);
                reSizePhoto ($newname);
        }
        if ($_POST['save'] == "Save Photo 2")
        {
                $newname = "images/" . $id . "_2.jpg";
                move_uploaded_file($_FILES['img2']['tmp_name'], $newname);
                reSizePhoto ($newname);
        }
        if ($_POST['save'] == "Save Photo 3")
        {
                $newname = "images/" . $id . "_3.jpg";
                move_uploaded_file($_FILES['img3']['tmp_name'], $newname);
                reSizePhoto ($newname);
        }
        if ($_POST['save'] == "Save Photo 4")
        {
                $newname = "images/" . $id . "_4.jpg";
                move_uploaded_file($_FILES['img4']['tmp_name'], $newname);
                reSizePhoto ($newname);
        }
        if ($_POST['save'] == "Save Photo 5")
        {
                $newname = "images/" . $id . "_5.jpg";
                move_uploaded_file($_FILES['img5']['tmp_name'], $newname);
                reSizePhoto ($newname);
        }
        if ($_POST['save'] == "Save Photo 6")
        {
                $newname = "images/" . $id . "_6.jpg";
                move_uploaded_file($_FILES['img6']['tmp_name'], $newname);
                reSizePhoto ($newname);
        }

 

It seems as if the $_POST is not coming thru on ie browsers.

 

Your help is appreciated

 

Thanks

Carl

 

Link to comment
Share on other sites

OK here's a more simple program that demonstrates the problem

 

<link rel="stylesheet" type="text/css" href="area.css">

<?php
print "the value is " . $_POST['save'];
if (($_POST['save'] == "Save Photo 1"))
        {
                $newname = "images/newfile_1.jpg";
                move_uploaded_file($_FILES['img1']['tmp_name'], $newname);
        }
?>
<form action="<?php print $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" method="POST">
<div class="piccontrol">
        <div class="pctitle">Photo</div>
        <div class="photo"><img width="400" height="300" src="images/10_1>"></img></div>
        <div class="icontrol">Image File: <input type="file" name="img1"></input></div>
        <div class="icontrol">
        <span><input type="image"  src="savephoto.gif" name="save" value="Save Photo 1"</span>
        <span><a href="<?php print $_SERVER['PHP_SELF'] . "?action=del" . $step . "&id=1";?>"><img src="deletephoto.gif" border="0"></img></a></span>
        </div>
</div>
</form>

 

This works fine in non MS browsers.

 

In the IE browsers the $_POST['save'] variable does not get populated.  I'm wondering if IE has a problem with the input type = image?

 

Carl

 

Link to comment
Share on other sites

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.