WS_FTP - A WinSock-based FTP Client for Windows 3.1 and Windows/NT. Written by : John A Junod. Modifications by : Santanu Lahiri Release Date : December 6th, 1993 Please read the installation guide before proceeding with the actual installation of this software, as there are some incompatibilities with the original version. This program was originally written by Mr John A. Junod, for Microsoft Windows 3.1. In this modified version, I have added a few features that I feel would be nice to have in a program of this kind. I have not made any substantial changes to the WS_FTP engine, as I believe Mr. Junod has done a really superb job on it, and the credit for the functionality should go to him. I have not had a chance to coordinate the changes with him, but I would like to take this opportunity to thank him for releasing the source to Public Domain. That has made it possible for me to learn some of the basics of WinSock programming from a working source. The original source to the program was an older version of the WS_FTP program. Any additions and alterations I have made are released to the Public Domain. If you use any of the code, please credit Mr. Junod. However, in making the modifications, I have probably also introduced some bugs that can affect performance. Please note that Mr. Junod had nothing to do with any such, and should not be held responsible for them in any way. I am also including the modified source for the entire project. Unfortunately, I do not have the necessary expertise in or access to Borland's compiler or environment to make the code portable to either. This current version has been compiled with Microsoft Visual C for Windows and Visual C for Windows NT. If you adapt this code to Borland's compiler, please consider making the source available as Public Domain. If you run into any bugs in this release, or would like to see other features, please let me know at the following address, or simply post on alt.winsock. I will attempt to maintain the source, but I can not guarantee a prompt turn-around. If you add to or modify the source, please consider contacting me so that I can incorporate the changes as well. Internet: slahiri@magnus.acs.ohio-state.edu BITNET : lahiri@ohsthr Disclaimer. ------------ While I have run this software on several different machines and operating systems, and have made an attempt to fix any bugs I've run into, you use this software at your own risk. To the best of my knowledge, the program is virus-free and has not exhibited any unusual tendencies to go berserk. However, I am not liable for any damages you may incur as a consequence of using this software. Also, while this release was posted using Ohio State University's resources, OSU is not responsible for it. ------------------------------------------------------------------------ Now with the pleasantries out of the way, here is a description of the release itself. Remember that the initialization file format is NOT compatible with the original WS_FTP initialization file. Converting the .INI File ------------------------- Since my configuration requirements were somewhat different from the original, I have stored the initital configurations in a file called WS_FTP.INI. The original WS_FTP program used the WINSOCK.INI file to store this information. I have an utility (WS_CVT) included with the archive that attempts to convert an existing WinSock.INI file into an equivalent WS_FTP.INI (the original .INI file remains untouched). The new .INI File format is given below. You can supply a Configuration string to name the configuration. One difference in the two configurations are the Host Types. I had included a new Host Type to handle a local IBM host. The Host File list format of this host was not compatible with the IBM VM file listing and was causing a lot of problems for the remote file list. This modification in turn required me to change the definitions of Host Types, so the NEW HOST TYPES ARE NO LONGER COMPATIBLE with the original version. Sorry folks, but this one will require a bit of checking on your part. The WS_CVT program will attempt to do the conversion, but I suggest you check the host types manually. In this version, the HostType values are as follows: AutoDetect 0 UNIX 1 QVT 8 IBM VM 2 IBM/TCP 9 VMS/Multinet 3 CHAMELEON 10 VMS/UCX 4 SUPER 11 PCTCP 5 SI NT FTPD 12 NCSA 6 IBM MVS 13 NOS 7 U5000 14 The following file is a sample WS_FTP.INI file. If you wish to set up a proper initialization file, you must edit all references to directories and all passwords. WIN16: Copy the WS_FTP.INI file into the WINDOWS directory WIN32: Copy the WS_FTP.INI file into the \WINNT directory Sample WS_FTP.INI file: --------------------------- [WS_FTP] CONFIG=Oakland FTP Service HOSTNAME=oak.oakland.edu USERID=anonymous MAILADDR=slahiri@magnus.acs.ohio-state.edu VIEWER=d:\pfe\pfe32 LogFile= LogFlag=On TempDir=D:\TEMP ConfigNum=20 ViewerCount=6 Retain=0 DblClk=1 AUTOSTART=1 FLAGS=21 CFG0=Oakland FTP Service CFG1=Monash FTP Archives CFG2=Biochemistry CFG3=Cica FTP Archives CFG4=SunSite Archives [WS_FTP:Viewer] Viewer1=A,.TXT,D:\PFE\PFE,D:\Docs Viewer2=I,.ZIP,D:\WIN\WIZ\WIZUNZIP Viewer3=I,.GIF,D:\WIN\WINGIF\WINGIF,D:\WIN\WINGIF Viewer4=I,.BMP,D:\WIN\WINGIF\WINGIF,D:\WIN\WINGIF Viewer5=A,.LST,D:\WIN\GANDER\GANDER Viewer6=I,.WRI,WRITE [WS_FTP:Oakland FTP Service] HostName=oak.oakland.edu UserID=anonymous PASS=slahiri@magnus.acs.ohio-state.edu HostType=0 TimeOut=65 [WS_FTP:Monash FTP Archives] HostName=ftp.cc.monash.edu.au UserID=anonymous PASS=slahiri@magnus.acs.ohio-state.edu DIR=/pub/win3 HostType=0 TimeOut=65 [WS_FTP:Biochemistry] HostName=biochemistry.bioc.cwru.edu UserID=anonymous PASS=slahiri@magnus.acs.ohio-state.edu HostType=1 TimeOut=65 [WS_FTP:Cica FTP Archives] HostName=ftp.cica.indiana.edu UserID=anonymous PASS=slahiri@magnus.acs.ohio-state.edu HostType=0 TimeOut=65 [WS_FTP:SunSite Archives] HostName=sunsite.unc.edu UserID=anonymous PASS=slahiri@magnus.acs.ohio-state.edu HostType=0 TimeOut=65 Release Notes: =================== This release includes a Win16 version of the program as well as a Win32 native application. The Win32 application was compiled with the Microsoft Visual C++/NT compiler for a 486 class machine. I am not sure if it will also run on a 386. You are welcome to try it. Listed below are the modifications I have made to the original source. Most of these are modifications I have made are a reflection of my personal requirements, not a bug fix. Modifications: -------------- + Added a Configuration entry to the HostName dialog, as well as the ability to save and delete configurations within the dialog. This allows you to have multiple logins defined for the same host using different configuration names. + Added a "Directory History" box for both local and remote sites so that you can pick a directory you have already visited, without having to traverse the entire tree. An extension to this feature will be associating frequently visited directories with each host, and I have rewritten the configuration file with this in mind. + Added File Specification filters. This will allow you to look for specific file types such as *.txt, or a*.zip in the remote host. + Added a Host Type IBM/MVS. This corresponds to a local IBM Installation at OSU where the original IBM-VM Specification was not applicable. + Added viewer support. You can now specify viewers through the Options Dialog and use them to view files at the remote of local host. See the section on Viewer Support for more details. + Added code to interpret a double-click on a file name as a View command rather than a file transfer. You can select the mode from the Options dialog. This was a request from an user of the Norton Desktop software. + Added Message Logging ability. Select the Log/Log To File option on the Debug window to enable or disable Message Logging. by default the function is disabled. I also have made an attempt to minimize the system resource requirement while the program is running. I have attempted this primarily by reducing the number of on-screen controls. However, I make no claim as to how much, if any, any milage you will gain on this count. The modifications were tested on a 486 PC Clone with several remote hosts using Peter Tattam's Trumpet Winsock Alpha#17 with the internal SLIP driver. The Windows NT version was tested using the Microsoft WinSock implementation released with the Windows NT SDK, final release. Tested with the following Host Types ------------------------------------ VMS/Multinet VMS/UCX QVT/Net Ultrix IBM MVS Known Bugs: ------------- I seem to have introduced a bug where the QVT/Net FTP server would hang after the client disconnects. I have not been able to correct it in this version. Apparently a "QUIT" command sent to remote Host is not enough to end the session there, even if you get the " logged out" message from QVT/Net. If anyone has any ideas, please contact me. On the Windows NT version, I get an error when I am uploading a file to the remote host - "Connection reset by peer". I am trying to track this. However, it does not seem to affect the actual upload. There is also a resource leak that I have not yet been able to identify. I believe it may have to do with the way I paint the screen (this bug would not be there in Mr. Junod's version). But the leak is sporadic, and if anyone else notices it, I would like to be informed so that I can fix it. Also any suggestions on tracking it is most welcome. Source Code Modifications ------------------------- In going through the original source, I have made a lot of changes to the source, primarily because it helped me understand different segments of it a little better, not because the original code failed (It had not :-0). However, at that time I did not think others might find the modifications useful, and the thought of releasing the modified version did not occur to me until recently. So it is difficult for me to identify the changes individually. Suffice to say that the FTP engine in the application is essentially unchanged, and credit for that goes to Mr Junod alone. Viewer Support --------------------- I have added Viewer support for various file types. You do need to define the viewers, though. The section in the .INI file labelled [WS_FTP:Viewer] has the following format: ViewerNN=,,[,] where TransferType is A (ASCII) or I (Image/Binary) FileExtension is of the form ".EXT" ViewerDirectory is the directory where the file will be viewed Example: Viewer1=A,.TXT,D:\PFE\PFE,D:\Docs Viewer2=I,.ZIP,D:\WIN\WIZ\WIZUNZIP If you manually add or delete viewers, you should also update the ViewerCount variable in the [WS_FTP] section The Viewer type is determined by the file extension, so this may or may not work for every type of file. Also, when specifying a viewer, you MUST specify the transfer type. For example, if you wish to view BMP files, you must set the transfer type to Binary, or the downloaded file will be garbage. Lastly, if there is no viewer defined, the Windows version will attempt to use the associations defined for the File Manager. If it does not find one, it will use the default viewer, with ASCII transfer type. Compiling for Windows Vs Windows NT ------------------------------------------ The source for the program is included in the ZIP file WSFTPSRC.ZIP. It is for both environments, except that when compiling under Windows NT, you need to define the symbol "WIN32". I have included makefiles for both Visual C++/Windows and Visual C++/WinNT. These can serve as a starting point if you wish to recompile the software.