<<

Contents

Search

>>

 

COPY_FILE_TO_CLIENT

 

 

Function

 

 

Syntax:

COPY_FILE_TO_CLIENT(<Source>,<Destination>)

 

<Source>

= <STRING-EXPRESSION>

<Destination>

= <STRING-EXPRESSION>

 

 

Meaning:

In the Java-2T-program this function copies the file <source> from the server to the file <destination> at the client.

 

If the program is no 2T-program, COPY_FILE_TO_CLIENT is identical with COPY_FILE.

 

In Html programs the browser has to save the file on the client computer. Because of safety reasons this cannot be done by javascript. Therefore a dialog appears on which the user has to click the file name in order to save the file.

 

Example: The file daten.dat has to be copied from the Webserver directory d:\daten to the directory c:\temp on the client computer. This is done by the following function call in the macro:

 

RET% = COPY_FILE_TO_CLIENT("d:\daten\daten.dat","c:\temp\daten.dat")

 

In the browser the following dialog appears:

 

 

To save the file the user has to be active. He has to right click the file name daten.dat. Then he has to select 'Ziel speichern unter' and he has to choose the target directory c:\temp.

 

Attention: It cannot be determined whether the user has saved the file. COPY_FILE_TO_CLIENT returns 0 even if the user did not save the file or the user saved the file in another directory or with another name.

 

COPY_FILE_TO_CLIENT returns the following values:

 

Value

 Meaning

0

File has been copied successfully.

-1

ERRORTEXT$ contains the error report.

1

Source file does not exist or is the directory.

2

Destination file cannot be created.

1080

ERRORTEXT$ contains the error report.

 

Parameter:

Source

Source filename

Destination

Destination filename

 

Sample:

RET% = COPY_FILE_TO_CLIENT("test.dat","/media/floppy/test.dat")

IF RET% <> 0

THEN ERRORMES = "Error: " + ERRORTEXT$

ENDIF

 

See also:

COPY_FILE

GET_FILE_FROM_CLIENT$

COPY_FILE_FROM_CLIENT