Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2005
    Location
    Ottawa, Ontario
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Uploading in Internet Explorer

    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:
    Code:
    <form action="addlisting.php" enctype="multipart/form-data" id="addlisting" method="post">
    My input element for the file upload looks like this:
    Code:
    <input id="corplogo" name="corplogo" type="file" />
    Any help on this would be greatly appreciated.
    Mike Badgley,
    A+ Web Creations

  • #2
    Regular Coder
    Join Date
    Apr 2005
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try adding this into your form
    Code:
    <input type='hidden' name='MAX_FILE_SIZE' VALUE='1000000'>

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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):
    Code:
    <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" />
    </form>
    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.

  • #4
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •