Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FTP file download
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
00980915
Message ID:
00985294
Views:
63
Hi Nadya,

MGET is not exactly an FTP command. This is a command of FTP.EXE utility that triggers a certain routine. I may guess this routine uses raw ftp command LIST (or NLIST) to enumerate files on the remote server. Then it calls RETR for each filename matching the mask.

* * *
Behind a single file being uploaded to an FTP server there's always a chain of raw FTP commands sent from local computer to the server. For example:

CWD /mydir/
TYPE I
PASV
STOR myfile.txt

For each raw command received, the server shoots a response back to the client:

250 CWD command successful
200 Type set to I
227 Entering Passive Mode [999,999,99,999,99,999]
125 Data connection already open. Transfer starting.
226 Transfer complete.

Once you get "226 Transfer complete" -- that's a confirmation that your upload completed successfully.

To program this functionality in Visual FoxPro, use FtpCommand along with other WinINet API calls. Another option is using Winsock ActiveX or Winsock API.

* * *
The InternetWriteFile in WinINet allows writing to an open file on remote server. So you may transfer your local file to an ftp server by small portions.

* * *
I apologize for that encyclopaedia :), an old piece of code that I should remove long time ago.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform