Tags:
create new tag
view all tags

Client-Side Processes & File Transfers

This page is intended for APPX Release 5.0 and earlier. In Release 5.1 various API's were introduced to perform these functions. See .CLIENT DOWNLOAD FILE, .CLIENT UPLOAD FILE and .CLIENT LOAD URL.

APPX Release 5.0 and prior

From ILF code on the server, you can now push files to the Java Client, pull files from the Client, and run a command line on the Client.

Sending a file to the client
-------------------------------

You can send a file to the client with a CALL command. If the destination filename is left blank, the client will open a dialog file browser so the use can place and name the file themselves. The value they select will be returned to the server and placed in the destination field. If the destination path is relative, it will be relative to the location of the Java Client JAR file location. While the file is in transit, the client will show a progress slider and the APPX session will wait until the file transfer completes before returning from the CALL statement. The T/F indicator will tell you if the transfer completed OK or not.

SET   1EX WORK SOURCE      =      C:\REGO.TXT 
SET   1EX WORK DESTINATION =      REGO99.TXT 
PASS  1EX WORK SOURCE      FIELD            SHARE? Y 
PASS  1EX WORK DESTINATION FIELD            SHARE? Y 
CALL      ,RT_SEND_FILE    RESIDENT? Y  END? N  FAIL 0 

WORK SOURCE and DESTINATION are not actually fields in 1EX. These workfields must be large enough to hold your passed values.

Pulling a file from the client
---------------------------------

You can pull a file from the client with a CALL command. If the source filename is left blank, the client will open a dialog file browser so the user can pick the file themselves. The value they select will be returned to the server and placed in the source field. If the source path is relative, it will be relative to the location of the Java Client JAR file location. While the file is in transit, the client will show a progress slider and the APPX session will wait until the file transfer completes before returning from the CALL statement. The T/F indicator will tell you if the transfer completed OK or not.

SET   1EX WORK SOURCE      = 
SET   1EX WORK DESTINATION =      /tmp/upload.txt 
PASS  1EX WORK SOURCE      FIELD            SHARE? Y 
PASS  1EX WORK DESTINATION FIELD            SHARE? Y 
CALL      ,RT_RECV_FILE    RESIDENT? Y  END? N  FAIL 0 

Running a command line on the client
--------------------------------------------

Using a version of the RT_LOAD_URL call, you can run a complete command line on the client machine. This is done by starting the command with the '@' symbol. This means run the command as is, at the client. This examples will take the results from the previous SEND and run Notepad against it on the client.

SET    --- TEMP 80       =      @NOTEPAD.EXE 
APPEND --- TEMP 80       1  1EX WORK DESTINATION 
SET    --- LI            =      80 
PASS   --- TEMP 80       FIELD            SHARE? Y 
PASS   --- LI            FIELD            SHARE? Y 
CALL       ,RT_LOAD_URL  RESIDENT? Y  END? N  FAIL 0 
 

=====
Example
=========

This example will download a print file and a print config file to a client and run winprint on the client to print the file. This assumes that the client already has a copy of winprint.exe in the same location as the JAR file or in the active PATH.

SET    1EX WORK SOURCE       =      /tmp/PRT0001 
SET    1EX WORK DESTINATION  =      PRT0001 
PASS   1EX WORK SOURCE       FIELD            SHARE? Y 
PASS   1EX WORK DESTINATION  FIELD            SHARE? Y 
CALL       ,RT_SEND_FILE     RESIDENT? Y  END? N  FAIL 0 
* 
SET    1EX WORK SOURCE       =      /tmp/PRT0001.cfg 
SET    1EX WORK DESTINATION  =      PRT0001.cfg 
PASS   1EX WORK SOURCE       FIELD            SHARE? Y 
PASS   1EX WORK DESTINATION  FIELD            SHARE? Y 
CALL       ,RT_SEND_FILE     RESIDENT? Y  END? N  FAIL 0 
* 
SET    --- TEMP 132          =      @WINPRINT.EXE 
APPEND --- TEMP 132          1      -config=PRT0001.cfg 
APPEND --- TEMP 132          1      PRT0001 
SET    --- LI                =      132 
PASS   --- TEMP 132          FIELD            SHARE? Y 
PASS   --- LI                FIELD            SHARE? Y 
CALL       ,RT_LOAD_URL      RESIDENT? Y  END? N  FAIL 0 

Comments:

Read what other users have said about this page or add your own comments.



Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2020-05-12 - JeanNeron
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback