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

Uploader - really wierd missing "}" error

Expand Messages
  • ricsterware
    I am trying to use the Uploader control and have done quite well with it, except for this one nagging error! I have implemented the control exactly as
    Message 1 of 1 , Jun 3, 2008
    • 0 Attachment
      I am trying to use the Uploader control and have done quite well with
      it, except for this one nagging error! I have implemented the control
      exactly as instructed (I think), and evrything works fine, until I
      actually start the upload process. Everything completes, and the
      files get uploaded, but I get the following error notice in the
      browser status line:

      Line: 1
      Char: 172
      Error: Expected '}'
      Code: 0
      URL: http://..../loader.htm

      I actually get the message 3 times, and only the Char. # changes (168
      and 174). It occurs only after the upload starts. Browsing does not
      cause it. Also, the report div does not show any errors either.

      My code looks like this:

      <HTML>
      <HEAD>
      <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">

      <!-- js -->
      <script type="text/javascript"
      src="http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-
      event.js"></script>
      <script type="text/javascript"
      src="http://yui.yahooapis.com/2.5.2/build/element/element-beta-
      min.js"></script>
      <script type="text/javascript"
      src="http://yui.yahooapis.com/2.5.2/build/uploader/uploader-
      experimental.js"></script>


      <TITLE>Loader</TITLE>
      </HEAD>




      <BODY bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0>









      <table WIDTH="550" CELLSPACING="0" CELLPADDING="0"
      style="MARGIN-LEFT: 0px; WIDTH: 550px; HEIGHT: 300px">
      <TR height=15>
      <TD width="260" height="15" align="middle" valign="center"
      nowrap>
      <FONT face=Arial color=#00008b>

      <span name="sFileCount" id=sFileCount>
      0</span> Files selected to Upload
      </FONT>

      </TD>
      <TD align=middle><INPUT style="WIDTH: 164px; HEIGHT: 24px"
      type=button size=58 value="Select Pictures to Upload" onClick="browse
      ();">    
      <INPUT style="WIDTH: 93px; HEIGHT: 24px" type=button size=32
      value="Start Upload" onClick="upload();"></TD>
      </TR>

      <TR bgcolor=dodgerblue>
      <TD align=middle>
      <P align=left><FONT
      style="BACKGROUND-COLOR: #1e90ff"
      color=white><U>         &
      nbsp;    
      File Name</U></FONT></P></TD>
      <TD>
      <P align=left><FONT style="BACKGROUND-COLOR: #1e90ff"
      color=white><U>File

      Size</U>          &n
      bsp;          
      <U><FONT size=2>Total Upload Size = <span id=sTotalSize
      name="sTotalSize">000 </span>
      MBs</FONT> </U></FONT></P>



      </TD></TR>

      <TR>
      <TD colspan=2 height=40 align=middle valign=top>
      <div align=center style="OVERFLOW-Y: scroll; FONT-SIZE: x-
      small; VERTICAL-ALIGN: top; WIDTH: 560px; FONT-FAMILY: sans-serif;
      HEIGHT: 258px; BACKGROUND-COLOR: whitesmoke; FONT-VARIANT: small-
      caps" >

      <div id="uploaderPlaceHolder"
      style="width:400px;height:210px">Unable to load Flash content. The
      Uploader Control requires Flash Player 9.0.45 or higher. You can
      download the latest version of Flash Player from the <a
      href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player
      Download Center</a>.</p></div>




      <script type="text/javascript">


      YAHOO.widget.Uploader.SWFURL = "/scripts/assets/uploader.swf";
      var uploader = new YAHOO.widget.Uploader
      ( "uploaderPlaceHolder" );
      uploader.addListener('fileSelect',onFileSelect)
      uploader.addListener('uploadStart',onUploadStart);
      uploader.addListener('uploadProgress',onUploadProgress);
      uploader.addListener('uploadCancel',onUploadCancel);
      uploader.addListener('uploadComplete',onUploadComplete);
      uploader.addListener('uploadCompleteData',onUploadResponse);
      uploader.addListener('uploadError', onUploadError);

      if (document.all("uploaderPlaceHolder").innerText.length==0) {
      document.all("uploaderPlaceHolder").style.width = 0;
      document.all("uploaderPlaceHolder").style.height = 0;
      }


      var fileList;

      function browse() {
      uploader.clearFileList();
      uploader.browse(true, [{description:"Images",
      extensions:"*.jpg;*.png;*.gif;*.bmp"}]);
      }

      function upload() {
      if (fileList != null) {
      for(var i in fileList) {
      uploader.upload(i, '/upload-base.asp');
      }
      }
      }

      function onFileSelect(event) {
      fileList = event.fileList;
      }

      function onUploadStart(event) {

      }

      function onUploadProgress(event) {

      }

      function onUploadComplete(event) {

      }

      function onUploadError(event) {

      }

      function onUploadCancel(event) {

      }

      function onUploadResponse(event) {

      }

      </script>




















      <table WIDTH=540 CELLSPACING="0" CELLPADDING="0"
      style="MARGIN-LEFT: 0px; WIDTH: 580px">

      <TR height=16>

      <TD width=30 align=middle>
      <IMG src="/images/A-Alert1.ICO" width=16
      border=0 >
      </TD>

      <TD width=175 align=left>
      <FONT size=2>
      filename.gif
      </FONT>
      </TD>

      <TD width=50 align=middle>
      <FONT size=2><FONT size=1>
      <A href="javascript:RemoveItem
      (0)">remove</A></FONT>
      </FONT>
      </TD>

      <TD width=80 align=middle>
      <FONT size=2>
      11,184 kb
      </FONT>
      </TD>


      <TD width=200 align=left valign=bottom>
      <HR id=PGbar name="PGbar" width=150
      align=left SIZE=5 style="BACKGROUND-COLOR: blue"><center><FONT
      size=1>24%</FONT></center>
      </TD>

      </TR>


      </table>
      </div>
      </TD></TR></table>

      </BODY>
      </HTML>

      can anyone explain this? any help will be appreciated!
    Your message has been successfully submitted and would be delivered to recipients shortly.