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

V 2.6.0 and problem with file uploading via Connection module

Expand Messages
  • Ron Savage
    Hi Folks (1) What happens: o The 3 alerts in the JS (part 3 below) all appear as expected o My web server s access_log does not receive the URL
    Message 1 of 1 , Oct 29, 2008
    • 0 Attachment
      Hi Folks

      (1) What happens:

      o The 3 alerts in the JS (part 3 below) all appear as expected

      o My web server's access_log does not receive the URL
      /contacts/person/upload, it receives another hit on the last-used URL

      o So, the form's data is not uploaded

      o I can get this to work without using YUI's Connection module, but
      the HTML is within a Tab in a TabView, and I want the server response
      to appear in the same Tab

      o The same program is using a number of other forms on Tabs, which
      have onSubmit=..., calling a function which returns false, and they
      all work. Just this one is odd

      o Help!?

      (2) Here's my HTML:

      <div id="upload_vfile_result"></div>
      <!-- Warning: This form action is never called because function
      upload_vfile() returns false. -->
      <form name="upload_vfile_form" id="upload_vfile_form" action=""
      method="post" enctype="multipart/form-data" onSubmit="return
      <tr><td>File name</td><td><input type="file" name="vfile_name"
      id="vfile_name" size="60" /></td></tr>
      <tr><td align="center" colspan="2"><input type="submit"
      name="submit_upload" value="Upload vFile" /></td></tr>
      <input type="hidden" name="sid" id="sid" value="<tmpl_var name=sid>" />

      The <tmpl_var...> thing is used by the Perl module HTML::Template.

      (3) Here's my JS:

      var upload_vfile_callback =
      upload: function(o)
      var e = document.getElementById("upload_vfile_result");

      if (o.responseText !== undefined)
      e.innerHTML = o.responseText;
      e.innerHTML = "The server's response is incomprehensible";
      failure: function(o)
      var e = document.getElementById("upload_vfile_result");
      e.innerHTML = 'The server failed to respond';

      function upload_vfile()
      var p = YAHOO.util.Connect.setForm("upload_vfile_form", true);
      var r = YAHOO.util.Connect.asyncRequest('POST',
      '/contacts/person/upload', upload_vfile_callback);

      return false;
    Your message has been successfully submitted and would be delivered to recipients shortly.