File Transfers | ||
SocketTools includes two components which are primarily used for uploading and downloading files. The File Transfer Protocol (FTP) control is used to transfer files between the local system and an FTP server on a server. This control also enables an application to list directories and search for files, perform remote file management tasks such as renaming and deleting files, as well as a number of other functions. The Hypertext Transfer Protocol (HTTP) control can also be used to transfer files, and the properties, methods and events for the two controls are very similar. A common question asked by most developers is which is the best protocol to use if you want to transfer files. This depends on a number of factors, including the type of server being connected to and what the program needs to do. As a general rule, FTP is a more complex protocol which offers more features in terms of the ability to manage files on a server. For example, you can use FTP to list all of the files in a directory on the server, search for those files which were modified after a certain date and download them. HTTP doesn't provide those kinds of facilities. However, FTP can present problems when it is used behind a firewall or a router which uses Network Address Translation (NAT) and applications which use FTP need to give users the ability to configure various options, such as whether or not passive-mode file transfers are used. On the other hand, HTTP offers a much simpler protocol and typically does not have the same kinds of problems when used from behind a firewall or NAT router. However, it does not have many of the more advanced file management features that FTP supports, and the ability to upload or delete files usually requires that the administrator of the web server make specific changes to allow this. Here are some general guidelines you can follow to determine which is the best protocol to use in a given situation:
If you decide to use the FTP control, make sure that you set the Passive property to True. This will force the control to only establish outbound connections to the server and ensures a broader range of compatibility with various firewall and router configurations. |
||
Copyright © 2023 Catalyst Development Corporation. All rights reserved. |