Jump to content

very simple file works in IE but not Firefox?


arianhojat

Recommended Posts

doh cant edit the title: meant 'very simple file upload works in IE but not Firefox?'...

using IE 6.0 and FF 1.5... i ran this simple script on our IIS server.
when i view the page on [a href=\"http://intranet:90/upload.php\" target=\"_blank\"]http://intranet:90/upload.php[/a] and i test uploading files, works quickly in IE.

But in FF, after i click submit, it slowly tries to submit it. bottom left corner of status bar says:
'Waiting for intranet' (and the tab 'square' where the Title is displayed says Loading...) I wait and the file never gets uploaded. Very weird to have a server side script issue run differently in FF?


[code]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Upload</title>
</head>

<body>
<?php
if( isset($_POST['submit']) )
{
    echo "SUBMITTING<br/>";

    foreach ($_FILES["filename"]["error"] as $key => $error)
    {
        if ($error == UPLOAD_ERR_OK)
        {
            $uploaddir = $_SERVER['DOCUMENT_ROOT'].'\\uploadFolder\\uploads\\';
            
            $tmp_name = $_FILES["filename"]["tmp_name"][$key];
            $name = $_FILES["filename"]["name"][$key];
            move_uploaded_file($tmp_name, "$uploaddir/$name");
            echo "Moved tmp_name=$tmp_name, name=$name, type=$type, size=$size<br/>";
        }
    }    
    

}//submitted

?>

<form name="upload" method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'];?>">

File to upload: <br/>
<input type="file" name="filename[]" value="Upload1" />
<br/>
<input type="file" name="filename[]" value="Upload2" />
<br/>

<br/>
<input type="submit" name="submit" value="Submit" />

</form>

</body>
</html>[/code]
Hello,

i think the problem here is not with your script but the settings of your FF browser....check if only [a href=\"http://intranet\" target=\"_blank\"]http://intranet[/a] is working in FF, i guess it wont....Change Your connection settings to allow loal addresses

hth

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.