SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make file uploading work in Internet Explorer? Guru's help needed.

    Hello,

    I have wrote code that uploads files from user's hard disks to the server and everything works fine in Firefox and Safari, but in Internet Explorer it uploads dummy files and cycles that. So when I try to upload one photo, I get a lot of dummy files on my server and a lot of record in MySQL insted of one record.

    I guess the problem in JS:

    <SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT">
    <!--

    imageWait = new Image(); imageWait.src = "http://www.roamearth.com/img/wait.gif";

    function showWaitImage() {
    document.getElementById('photoSubmit').disabled = true;
    document.getElementById('photoSubmit').value='Закачивается...';
    var showMap = document.getElementById("showMap");
    showMap.innerHTML = '<iframe src="http://www.roamearth.com/empty.html" frameBorder=0 scrolling=no>';
    var mapThisPhoto = document.getElementById("mapThisPhoto");
    mapThisPhoto.innerHTML = '<span></span>';

    parent.changeFrameSizePhoto();
    var div = document.getElementById("image");
    div.innerHTML = '<table width="100%" cellspacing="0" cellpadding="0"><tr><td align="center"><span class="style">Фотография закачивается, пожалуйста подождите...<br /><br />&nbsp;<br />&nbsp;<br /><img src="http://www.roamearth.com/img/wait.gif" id="myImage" /></span></td></tr></table>';
    document.getElementById("myImage").onload = function() {
    document.getElementById("photoForm").submit();
    }
    return false;
    }


    //-->
    </SCRIPT>

    The form looks like it's ok:
    <form name="photoForm" id="photoForm" action="uploadsub.php?geo=3017382&dest=&typet=ph&lang=ru" method="post" enctype="multipart/form-data"><input type="hidden" name="MAX_FILE_SIZE" value="4000000" /><input size="15" name="url" type="file" style="border:1px solid #777777" class="style">
    <input value="Закачать" type="submit" class="style" name="photoSubmit" id="photoSubmit" onclick="return showWaitImage()"></form>

    The live script is here (you can login by using login "test" and password "thetest"):
    Live script

    I wonder what part of code doesn't work in IE? Why that happens?

  2. #2
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone please?

    Is the problem with document.getElementById("photoForm").submit();?

  3. #3
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I haven't really looked into this, but how about closing the iframe tag?

  4. #4
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pepejeria View Post
    I haven't really looked into this, but how about closing the iframe tag?
    I've added closing tag, but the code still doesn't work in IE. It reuploads photo unlimited number of times.

  5. #5
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by al9 View Post
    I've added closing tag, but the code still doesn't work in IE. It reuploads photo unlimited number of times.
    Can you give me advice about where can I ask this question please? Is there any IE specified forum?


Bookmarks

Posting Permissions

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