GUI ScreenIO for Windows

 ScreenIO.com


CopyFileFromClient

The CopyFileFromClient function copies a file from the client to the specified location on the server.

Client/Server issues

This API will normally copy a file from the client to the specified location on the server. 

If the application is not running in client/server mode, it performs a CopyFile. Therefore, for those applications which run in both client/server and in a single machine, you can use this function call and expect it to work in all cases.

Note: 

The file is first transferred, using the original filename, to a temporary directory on the server.  When the transfer is complete, the server executes CopyFile to copy the file to the specified destination, changing the name if requested. 

Because the server uses the same temporary directory for all clients, you must ensure that the filename is unique for each client.  The function will fail if the same filename is copied from two clients at the same time.

Files

Files available to copy to your system:

Usage

     COPY WIN32API.
     COPY COPYFILE.

* ------------------------: Call the API.

     SET FUNC-COPYFILEFROMCLIENT TO TRUE.

     CALL 'GSWINAPI' USING WIN32API-PARMS
                           CF-SOURCE
                           CF-DESTINATION
                           CF-FLAGS
                           WIN32API-D
                           WIN32API-E
                           WIN32API-F.

Parameters specific to this function

CF-SOURCE

Pathspec of source file (up to 1024 bytes).

CF-DESTINATION

Pathspec of destination (up to 1024 bytes).

CF-FLAGS

Copy options; set the desired one to TRUE before you call GSWINAPI.

To replace an existing file of the same name:

    SET CF-IF-EXIST-REPLACE TO TRUE

To fail if the target file exists:

    SET CF-IF-EXIST-FAIL TO TRUE

Same as CF-IF-EXIST-REPLACE, replaces the destination file:

    SET CF-SYNCHRONIZE-FILE TO TRUE

Note: When operating under Client Server, this option operates slightly different than CF-IF-EXIST-REPLACE.
CF-IF-EXIST-REPLACE will always copy the file from the client and replace the file on the server.  

The CF-SYNCHRONIZE-FILE option will copy the file from the client to the GUI ScreenIO Server's internal Cache and then it will replace the destination file on the server.  Upon subsequent calls to Copy the same file, it will compare date and time of the cached version and the client's version, and only transmit the file if it is different.  In all cases it will copy from cache to your destination.  This can be dramatically faster, and is meant as a way of collecting files from remote clients, and keeping those files up-to-date.

 

WIN32API-PARMS - Used in all GSWINAPI calls

This argument is standard for all CALLs to GSWINAPI. It is used to select the desired API or function, and to return the status of the operation.

WIN32API-RC

Used to return the status of a call to GSWINAPI.  A value of zero is a failure, any other value indicates success.

Recommended usage is to test the 88-level value WIN32API to see if it worked, then to use the text error message to see why it failed.

* ------------------------: If function failed,
*                         :   display the error in a message box.
*
     IF WIN32API-FAILED
       MOVE WIN32API-ERROR-TEXT TO panel-MESSAGE-TEXT
       SET panel-MESSAGE-IN-MESSAGEBOX TO TRUE.

WIN32API-ERROR-CODE

Error code that was returned by Windows.  This is not generally useful unless you have the Windows Platform SDK documentation available to you.

WIN32API-ERROR-TEXT

Plain-text error message that describes why the operation failed.

WIN32API-A through WIN32API-F

The number of these present varies depending on how many arguments are used by the desired function.  These are not used, but must be present because this CALL requires seven arguments.

WARNING!

You should be aware that malicious and knowledgeable users may be able to substitute a Trojan file for the one you intended to copy from their machine to the server.  Use this Up-Load capability with great care.  It is unwise to upload anything from the client that may be executable.  It would be wise to run a virus scanner on your server that checks each file as it is written.


2000-2006 Norcom, all rights reserved 

TOC

Send feedback to Norcom