Jump to content

Recommended Posts

I've read a few other topics here and google on this, but have been unable to find a solution.

 

Here is the probelm,

 

I have a script that allows a user to upload a file via php...they get to this script after they are logged in via .htaccess.

 

Anyway, the script is fine in FireFox..I've uploaded 30MB files before....however in IE7 it times out.

 

I can upload a 40KB file in IE, but a 89KB file times out.

 

I am completely lost and have no idea.

 

Server: RHEL5

PHP = 5.2.4 with Zend Optimizer V3.3.0

Apache is 2.2

 

 

HTML form Code:

<form enctype="multipart/form-data" action="uploader.php" method="POST">

<input type="hidden" name="MAX_FILE_SIZE" value="9000000000000000" />

Choose a file to upload: <input name="uploadedfile" type="file" /><br>
<br />

<input type="submit" value="Upload File" />

</form>

 

 

PHP Code:

<?php



// Where the file is going to be placed
$target_path = "uploads/";

/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$_FILES['uploadedfile']['tmp_name'];

$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']).
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";
}

?>

 

Any insight / help that can be provided is greatly appreciated.

 

Thanks!

 

 

EDIT: THis script works in IE6, but not IE7.

Link to comment
https://forums.phpfreaks.com/topic/85384-upload-script-times-out-in-ieworks-in-ff/
Share on other sites

I should of mentioned this before probably.

 

When it times out in IE7, it takes me to a "Internet Explorer cannot display the webpage"

 

I added the print_r($_FILES); to the top of my php file, but its the same thing..

 

"Internet Exploerer cannot display the webpage"

I removed

 

<input type="hidden" name="MAX_FILE_SIZE" value="9000000000000000" />

 

from the HTML code..but its still doing the same thing :(

 

 

I ran the script again from firefox after adding the print_r command and this is what was returned:

 

Array ( [uploadedfile] => Array ( [name] => Copy of B757 PARTS LIST IN STOCK-version 2.xls [type] => application/vnd.ms-excel [tmp_name] => /tmp/phpPxsDR9 [error] => 0 [size] => 160256 ) ) The file Copy of B757 PARTS LIST IN STOCK-version 2.xls has been uploaded

well if IE ever gets to that second page and you can see an error that isn't 0 you can figure out what is error, but I think its IE7 browser having issue with the file, to test it have it process to itself and see if it at least goes without doing anythign

Talking about going straight to the .php and skipping going through the html to get to the code?

 

If so that does work, and I get:

 

Array ( ) There was an error uploading the file, please try again!

 

Its just anything larger than 40-50KB kills it :(

 

What kills me, is that IE6 will work fine...its just IE7 :(

 

 

changed the form code to show this

 

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

 

Then put the php code on the same page as the index file....but same thing.

 

Firefox will upload the files, IE7 still times out..goes to a "IE cannot display the webpage".

 

bah :(

 

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.