**************************************************************** PROCEDURE vc_ftpget ( p_host, p_usr, p_pword, p_remotefil, p_destination, p_remoteloc ) *************************************************************** DECLARE INTEGER InternetOpen IN wininet.DLL; STRING sAgent, INTEGER lAccessType, STRING sProxyName,; STRING sProxyBypass, STRING lFlags DECLARE INTEGER InternetCloseHandle IN wininet.DLL INTEGER hInet DECLARE INTEGER InternetConnect IN wininet.DLL; INTEGER hInternetSession, STRING sServerName,; INTEGER nServerPort, STRING sUsername,; STRING sPassword, INTEGER lService,; INTEGER lFlags, INTEGER lContext DECLARE INTEGER FtpGetFile IN wininet.DLL; INTEGER hFtpSession, STRING lpszRemoteFile,; STRING lpszNewFile, INTEGER fFailIfExists,; INTEGER dwFlagsAndAttributes,; INTEGER dwFlags, INTEGER dwContext DECLARE INTEGER FtpSetCurrentDirectory IN wininet.dll; INTEGER hFtpSession, STRING @lpszDirectory * server-side variable sAGENT is the target sAgent = "vfp" sProxyName = CHR(0) && no proxy needed sProxyBypass = CHR(0) && nothing to bypass lFlags = 0 && no flags used * initialize access to Inet functions hOpen = InternetOpen (sAgent, INTERNET_OPEN_TYPE_DIRECT,0,0,0) IF hOpen = 0 MESSAGEBOX( "Unable to get access to WinInet.Dll", 0, 'Comm error') RETURN ENDIF * connecting to the FTP hFtpSession = InternetConnect (hOpen, p_host,; INTERNET_INVALID_PORT_NUMBER,; p_usr, p_pword,; INTERNET_SERVICE_FTP, 0, 0) IF hFtpSession = 0 * close access to Inet functions and exit = InternetCloseHandle (hOpen) MESSAGEBOX( "Unable to connect to the selected FTP" , 0, 'Connect error') RETURN ENDIF IF !EMPTY( p_remoteloc ) && set the correct directory for files IF FtpSetCurrentDirectory (hFtpSession, @p_remoteloc) MESSAGEBOX("Directory Found and Set",0,"OK",10) ENDIF ENDIF * downloading a file from the FTP * no check whether the target file exists lpszRemoteFile = p_remotefil lpszNewFile = p_destination fFailIfExists = 0 && do not stop if the target already exists dwContext = 0 lnResult = FtpGetFile (hFtpSession, lpszRemoteFile, lpszNewFile,; fFailIfExists, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_ASCII,; dwContext) IF lnResult <> 1 MESSAGEBOX( "Unable to download selected file", 0, 'Trouble') ENDIF * close handles = InternetCloseHandle (hFtpSession) = InternetCloseHandle (hOpen) RETURN ENDPROC ***********************************************************Please help ... *smile*