View Full Version : Uploading in Internet Explorer
06-21-2005, 02:28 AM
I have this problem with Internet Explorer that when I try and upload a file, immediately I get a "The page cannot be displayed" error when I submit the form.
I've tested this in Mozilla, Firefox, Opera and there are no problems at all. This is only happening with my current version of IE (6.0.29). Does anyone know what is causing this problem?
By the way, my form looks like this:
<form action="addlisting.php" enctype="multipart/form-data" id="addlisting" method="post">
My input element for the file upload looks like this:
<input id="corplogo" name="corplogo" type="file" />
Any help on this would be greatly appreciated.
06-21-2005, 01:03 PM
try adding this into your form
<input type='hidden' name='MAX_FILE_SIZE' VALUE='1000000'>
06-21-2005, 04:16 PM
Hmm, thats the oddest thing that I've seen for awhile.
I use windows 98 IE 6.0.28 and have had no problems with this (simple throw together):
<form action="$_SERVER[PHP_SELF]" method="post" enctype="multipart/form-data">
<input type="hidden" name="do" value="doupload" />
New Name: <input type="text" name="name" value="" /><br />
Select File: <input type="file" name="file" />
<input type="submit" value="Submit" />
Now, I haven't tried it with yours, so I don't know if this is the problem, but perhaps IE is dying with the enctype location. I always place enctype at the end of my form attributes, though I have heard no issues with location for this attribute, perhaps its whats killing it. I've always placed mine for preference :P
Id should be no issue for the html, to my knowledge use of ID is prefered over the use of name and can be used as name as well, so I don't think thats the issue. But you shouldn't need a maxfilesize in there, not that you should ever rely on that one :P.
Hmm, don't know what to tell you, without any other code I'd say just try moving your enctype see if that fixes it, it really is more of an html/os issue, but I don't know whats causing it.
06-21-2005, 04:58 PM
Just to add to this, I tested moving the enctype and, as expected, it made absolutely no difference to the result. I also tried using an id and a name for the elements and I tried having just an id, just a name, both an id and name and neither id or name in the <form> tag, it worked with all methods. I also played around with the order of the elements in the <input> tag, again it made absolutely no difference. Also leaving out the max filesize made no difference.
I'm using IE 6.0.2900 with XPSP2 and I can't get it to replicate the error you're experiencing. I can't imagine what's causing it, could you show us some more code in case there's something else in there causing the problem? Also, did you try Fou's stripped-down code just by itself without any other code to see if you still get the error?
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.