Loading ...
Sorry, an error occurred while loading the content.

IE 7 YUI Connection Manager File Upload problem

Expand Messages
  • adamstokar
    I am trying to do an asynchronous file upload and display the files that were uploaded on the same page. The following code works perfectly in Firefox 2 and
    Message 1 of 5 , Aug 1 1:26 PM
    • 0 Attachment
      I am trying to do an asynchronous file upload and display the files
      that were uploaded on the same page. The following code works
      perfectly in Firefox 2 and 3. In IE, when I click upload, it send me
      the response back in a new page, ignoring the Asynchrounous call.
      Does anyone know why this would be?


      The javascript:

      function writeFileList(o) {
      var div = DOM.get('upload-list');
      div.innerHTML = o.responseText;
      }

      var uploadHandler = {
      upload: writeFileList,
      failure: handleError,
      argument: null
      };

      function uploadFile() {
      var form = DOM.get('uploadForm');
      if(form.target.value == "") {
      alert('Please select a file');
      return;
      }

      YAHOO.util.Connect.setForm(form,true);
      var request =
      YAHOO.util.Connect.asyncRequest('POST','attach.do',uploadHandler,null);
      }

      The HTML:

      <form name="attachmentForm" id="uploadForm" action="attach.do"
      method="post" enctype="multipart/form-data">
      <input type="file" name="target" size="80" />  
      <input type="button" value="Upload" onclick="uploadFile()"/>
      </form>

      I obviously don't want the response to come back in a new page but IE
      doesn't get that.

      Thanks.
    • dietrich.frank
      ... I lately had an issue driving me up the wall where something did not work in IE and I could not see why. It turned out that I obviously hit a keyword. A
      Message 2 of 5 , Aug 1 3:01 PM
      • 0 Attachment
        > I am trying to do an asynchronous file upload and display the files
        > that were uploaded on the same page. The following code works
        > perfectly in Firefox 2 and 3. In IE, when I click upload, it send me
        > the response back in a new page, ignoring the Asynchrounous call.
        > Does anyone know why this would be?


        I lately had an issue driving me up the wall where something did not
        work in IE and I could not see why. It turned out that I obviously hit
        a keyword. A simple underscore was the cure.

        So, this is just a shot in the dark but in

        ...
        <input type="file" name="target" size="80" />  
        <input type="button" value="Upload" onclick="uploadFile()"...


        name="target" could be misinterpreted as You would normally
        target="_blank" in a link. That would answer why the response lands in
        a new browser instance.


        Try to rename "target", maybe it helps
      • adamstokar
        That could very well be it. I ll try it when I get back to work on Monday. Thanks for the help.
        Message 3 of 5 , Aug 2 7:34 AM
        • 0 Attachment
          That could very well be it. I'll try it when I get back to work on
          Monday. Thanks for the help.

          --- In ydn-javascript@yahoogroups.com, "dietrich.frank"
          <fdietrich@...> wrote:
          >
          > > I am trying to do an asynchronous file upload and display the files
          > > that were uploaded on the same page. The following code works
          > > perfectly in Firefox 2 and 3. In IE, when I click upload, it send me
          > > the response back in a new page, ignoring the Asynchrounous call.
          > > Does anyone know why this would be?
          >
          >
          > I lately had an issue driving me up the wall where something did not
          > work in IE and I could not see why. It turned out that I obviously hit
          > a keyword. A simple underscore was the cure.
          >
          > So, this is just a shot in the dark but in
          >
          > ...
          > <input type="file" name="target" size="80" />  
          > <input type="button" value="Upload" onclick="uploadFile()"...
          >
          >
          > name="target" could be misinterpreted as You would normally
          > target="_blank" in a link. That would answer why the response lands in
          > a new browser instance.
          >
          >
          > Try to rename "target", maybe it helps
          >
        • adamstokar
          Couldn t wait till Monday. I changed the name and it worked. Thank you so much!! ... send me
          Message 4 of 5 , Aug 2 8:02 AM
          • 0 Attachment
            Couldn't wait till Monday. I changed the name and it worked. Thank
            you so much!!


            --- In ydn-javascript@yahoogroups.com, "adamstokar" <adamstokar@...>
            wrote:
            >
            > That could very well be it. I'll try it when I get back to work on
            > Monday. Thanks for the help.
            >
            > --- In ydn-javascript@yahoogroups.com, "dietrich.frank"
            > <fdietrich@> wrote:
            > >
            > > > I am trying to do an asynchronous file upload and display the files
            > > > that were uploaded on the same page. The following code works
            > > > perfectly in Firefox 2 and 3. In IE, when I click upload, it
            send me
            > > > the response back in a new page, ignoring the Asynchrounous call.
            > > > Does anyone know why this would be?
            > >
            > >
            > > I lately had an issue driving me up the wall where something did not
            > > work in IE and I could not see why. It turned out that I obviously hit
            > > a keyword. A simple underscore was the cure.
            > >
            > > So, this is just a shot in the dark but in
            > >
            > > ...
            > > <input type="file" name="target" size="80" />  
            > > <input type="button" value="Upload" onclick="uploadFile()"...
            > >
            > >
            > > name="target" could be misinterpreted as You would normally
            > > target="_blank" in a link. That would answer why the response lands in
            > > a new browser instance.
            > >
            > >
            > > Try to rename "target", maybe it helps
            > >
            >
          • Frank Dietrich
            ... Hey, great news on Saturday afternoon. This is one of those problems that You only finde accidentally or with a good portion of distance. Until that, You
            Message 5 of 5 , Aug 2 9:25 AM
            • 0 Attachment
              >Couldn't wait till Monday. I changed the name and it worked. Thank
              >you so much!!


              Hey, great news on Saturday afternoon.

              This is one of those problems that You only finde accidentally
              or with a good portion of distance.
              Until that, You (I) normally bang Your head against the wall
              not willing to understand what is going on (or better: not going on)

              Frank
            Your message has been successfully submitted and would be delivered to recipients shortly.