User Tools

Site Tools


ftpclientscriptexample

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ftpclientscriptexample [2022/01/16 00:13] – wikiadminftpclientscriptexample [2024/12/28 09:36] (current) – wikiadmin
Line 45: Line 45:
 <code javascript> <code javascript>
  
-var System = Java.type("java.lang.System");+
  
 //FTP the a file to the server configured in ErgoTechConfiguration.properties //FTP the a file to the server configured in ErgoTechConfiguration.properties
 function ftpFile (fileName,localPath) { function ftpFile (fileName,localPath) {
 +
 +var System = Java.type("java.lang.System");
  
 hostname = System.getProperty("ftpHostname",""); //hostname can be an ip address or a named server as long as the name resolves hostname = System.getProperty("ftpHostname",""); //hostname can be an ip address or a named server as long as the name resolves
Line 96: Line 98:
          
      ftpClient.setDataTimeout(400);      ftpClient.setDataTimeout(400);
 +     // to transfer binary files, use the following call (not required for ASCII transfers).
 +     ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE); // Set to binary mode
      ftpClient.enterLocalPassiveMode(); //client to server data transfer      ftpClient.enterLocalPassiveMode(); //client to server data transfer
                
Line 117: Line 121:
      }      }
        
- } //end of ftpResults function+ } //end of ftpFile function
 </code> </code>
  
ftpclientscriptexample.1642310012.txt.gz · Last modified: by wikiadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki