PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Progress of file transfer
  • Frequency of the event
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Retrieves an existing file from an FTP server (File Transfer Protocol) powered by WINDEV. The file is retrieved by the client computer.
Note: To allow (or not) the use of this function on an FTP/RPC server, call NetServerOption.
// -- Code of button for file retrieval
HourGlass(True)
IF NetGetFile(ConnectFTP, "C:\autoexec.bat", "C:\autoexec.cli", ...
WM_MYMESSAGE, 10) = False THEN
Error("Error while transferring the file")
END
HourGlass(False)
Syntax
<Result> = NetGetFile(<Connection Identifier> , <File on Server> , <File on Client Computer> [, <Event> [, <Event Frequency>]])
<Result>: Boolean
  • True if the transfer was performed,
  • False otherwise.
The function immediately returns a status report and the transfer is performed in parallel in another Windows task
<Connection Identifier>: Integer
Connection identifier (returned by NetConnect).
<File on Server>: Ansi character string (with quotes)
Full name (name and path) of file to copy, found on the server.
<File on Client Computer>: Ansi character string (with quotes)
Full name (name and path) of file copied onto the client computer.
<Event>: Character string or integer (optional)
Custom event or Windows event sent to the client to follow the progress of the transfer (see the Notes).
<Event Frequency>: Optional integer
Frequency (in percentage of the size of the file) at which the <Event> message is sent to the client.
Remarks

Progress of file transfer

The progress of the file transfer is managed in the FTP client program only.
NetGetFile is not a locking function: the file transfer is performed in background task. However, you have the ability to transfer a single file at a time.
To transfer several files, you must wait for each file to be transferred before transferring the next one.
In this case, two parameters can be used with NetGetFile:
  • a progression message (<Event> parameter),
  • a frequency (<Event Frequency> parameter).
NetGetFile sends the specified message to follow the progress of transfer. This message must be intercepted by Event. The message contains two parameters:
  • _EVE.wParam indicates the transfered size (progress indicator),
  • _EVE.lParam indicates the total size of the file.
The progress message is processed in the procedure called by Event. In this procedure, you can:
  • display a progress bar by using the parameters of the message (_EVE.lParam and _EVE.wParam),
  • find out whether file transfer is completed (in this case, _EVE.lParam = _EVE.wParam).

Frequency of the event

<Event Frequency> is used to define the minimum frequency for sending messages. For example, for a 1 MB file and a 10% frequency, a message will be received whenever 100 KB are transferred.
The frequency defines the maximum number of messages that can be received. The number of messages received is reduced when the transfer is fast.
For example, for a 100KB file and a 10% frequency, about 10 messages will be received: 1 message whenever 10 KB are transferred. In fact, the number of messages will be less because the transfer is fast.
Tips regarding the choice of frequency:
  • If no progression bar is displayed, the best choice for the frequency is set to 100%: A single message will be received when the file transfer is completed.
  • If the transfer rate is slow (transfer by modem for instance), we recommend that you display a progress bar. A frequency of 10% is appropriate in most cases.
  • If the transfer rate is fast (local network for instance), we do not recommend that you use a small frequency (1% for example) because the volume of messages received could saturate the system. In this case, a frequency of 10% is appropriate in most cases.
Components
WINDEVReports and Queries wd230com.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment