<<

Contents

Search

>>

 

COPY_FILE_FROM_CLIENT

 

 

Function

 

 

Syntax:

COPY_FILE_FROM_CLIENT(<Source>,<Destination>)

 

<Source>

= <STRING-EXPRESSION>

<Destination>

= <STRING-EXPRESSION>

 

 

Meaning:

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

 

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

 

In Html programs the user has to select the file. If no file is selected COPY_FILE_FROM_CLIENT returns -2. If a file has been selected EBUS_DATA$ contains the selected filename.

 

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

 

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

 

In the browser the following dialog appears:

 

 

To upload the file the user has to click the button 'Browse' and has to select the specified file. By pressing the button 'Upload file' the file is uploaded.

 

 

COPY_FILE_FROM_CLIENT returns the following values:

 

Value

 Meaning

0

File has been copied successfully.

-1

ERRORTEXT$ contains the error report.

-2

No file has been selected (Html).

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_FROM_CLIENT("c:\test.dat","H:\data\test.dat")

IF RET% <> 0

THEN ERRORMES = "Error: " + STR$(RET%) + " " + ERRORTEXT$

ENDIF

 

See also:

COPY_FILE

COPY_FILE_TO_CLIENT

GET_FILE_FROM_CLIENT$