2 Replies Latest reply on Dec 19, 2011 11:17 AM by Darrell Ortiz

    FTP Program

    Darrell Ortiz

      Hello, I am trying to run the following code with no luck. Can you help?

       

      <!DOCTYPE html>
      <HTML>
      <HEAD>
        <TITLE>CDM Mobile Event Manager</TITLE>
      <link type="text/css" rel="stylesheet" href="app.css" />
        <META HTTP-Equiv="FileTransfer" Content="TransferEvent:url('Javascript:alert('%s')'); Transfer">
        <script type="text/javascript">
          function uploadToFTP()
          {
          alert('Process Start');
          FileTransfer.source = Source:url('file://\\abc\\transfer\\file.txt');
          FfileTransfer.destination = url('ftp://-----:------@0.0.0.0/file.txt');
          FileTransfer.transfer();
          window.location = "index.html"
          }
        </script>
      </HEAD>

      <body>
      <div id="header">
          <h1><img id="logo" src="xmit.jpg"></img></h1>
          <H2>Transmit Data</H2>
          <a href="index.html"><button id="mainButton" class="button" >BACK</button></a>
      </div>
        <div id="headerBorder"></div>
        <button id="transmitButton" class="button" onclick="uploadToFTP();" >Begin</button></a>
      </body>
      </HTML>

        • Re: FTP Program
          Robert Galvin

          Darrel

           

          You had a couple of syntax errors in your code. The three key lines should be:

          fileTransfer.source = "url('file://\\abc\\transfer\\file.txt')";
          fileTransfer.destination = "url('ftp://username:password@192.168.1.30:21/file.txt')";
          fileTransfer.transfer();
          

           

          instead of

           

          FileTransfer.source = Source:url('file://\\abc\\transfer\\file.txt');

          FfileTransfer.destination = url('ftp://-----:------@0.0.0.0/file.txt');

          FileTransfer.transfer();

           

          The case on the FileTransfer should be fileTransfer.

          The fileTransfer.destination has an extra 'F'

          The source and destintation values need to be wrapped in double quotes (pluse remove Source:).