| Uploading Files | ||
|
The PutFile method is used to upload files using either the FTP or HTTP controls. In its simplest form, the method accepts two arguments, the name of the local file to upload and the name of the file that will be created or overwritten on the server. For example, consider a form which has five TextBox controls and a CommandButton control:
In this example, the user specifies the name of a server, a username and a password. In most cases, servers only permit authenticated users to upload files, so this information is usually required. This same code would work with the HTTP control to upload a file to a web server. To provide some feedback to the user as to the status of the transfer, a ProgressBar control could be added to the form. To update the progress bar, a handler for the OnProgress event would also be added:
Simply setting the Value property of the ProgressBar control to the Percent argument in the event handler will update the progress bar during the file transfer process. As with the previous code, this can also be done using the HTTP control in the same way. |
||
|
Copyright © 2025 Catalyst Development Corporation. All rights reserved. |