Using Win32 functions in Visual FoxPro Image Gallery
Internet Functions (WinInet)
..msdn
CreateMD5SSOHash
DeleteUrlCacheEntry
DetectAutoProxyUrl
FindCloseUrlCache
FindFirstUrlCacheEntry
FindFirstUrlCacheGroup
FindNextUrlCacheEntry
FindNextUrlCacheGroup
FtpCommand
FtpCreateDirectory
FtpDeleteFile
FtpFindFirstFile
FtpGetCurrentDirectory
FtpGetFile
FtpGetFileSize
FtpOpenFile
FtpPutFile
FtpRemoveDirectory
FtpRenameFile
FtpSetCurrentDirectory
GetUrlCacheEntryInfo
HttpOpenRequest
HttpQueryInfo
HttpSendRequest
InternetAttemptConnect
InternetAutodial
InternetAutodialHangup
InternetCanonicalizeUrl
InternetCheckConnection
InternetCloseHandle
InternetConnect
InternetCrackUrl
InternetDial
InternetFindNextFile
InternetGetConnectedState
InternetGetConnectedStateEx
InternetGetCookie
InternetGetLastResponseInfo
InternetGoOnline
InternetOpen
InternetOpenUrl
InternetQueryDataAvailable
InternetQueryOption
InternetReadFile
InternetSetCookie
InternetSetFilePointer
InternetTimeFromSystemTime
InternetTimeToSystemTime
InternetWriteFile
Code examples:
Custom FTP Class for Visual FoxPro application
How to download a file from the FTP server using FtpGetFile
FtpGetFile
    Add comment     W32 Constants      Translate this page
Retrieves a file from the FTP server and stores it under the specified file name, creating a new local file in the process.
Code examples:
Custom FTP Class for Visual FoxPro application
How to download a file from the FTP server using FtpGetFile
Declaration:
BOOL FtpGetFile(
    HINTERNET hConnect,
    LPCTSTR lpszRemoteFile,
    LPCTSTR lpszNewFile,
    BOOL fFailIfExists,
    DWORD dwFlagsAndAttributes,
    DWORD dwFlags,
    DWORD_PTR dwContext
);

FoxPro declaration:
DECLARE INTEGER FtpGetFile IN wininet;
    INTEGER hFtpSession,;
    STRING  lpszRemoteFile,;
    STRING  lpszNewFile,;
    INTEGER fFailIfExists,;
    INTEGER dwFlagsAndAttributes,;
    INTEGER dwFlags,;
    INTEGER dwContext
Parameters:
hConnect
[in] Valid handle to an FTP session.

lpszRemoteFile
[in] Pointer to a null-terminated string that contains the name of the file to retrieve from the remote system.

lpszNewFile
[in] Pointer to a null-terminated string that contains the name of the file to create on the local system.

fFailIfExists
[in] BOOL that indicates whether the function should proceed if a local file of the specified name already exists.

dwFlagsAndAttributes
[in] Unsigned long integer value that contains the file attributes for the new file.

dwFlags
[in] Unsigned long integer value that contains the flags that control how the function will handle the file download.

dwContext
[in] Pointer to an unsigned long integer value that contains the application-defined value...
Return value:
Returns TRUE if successful, or FALSE otherwise
Word Index links for the FtpGetFile :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2001-07-15 12:00:00
Modified: 2001-11-26 16:02:26
Visited in last 7 days: 18
User Contributed Notes:
Boris | 2006-01-09 16:23:14
Is there any way to resume download from ftp site?
I know for sure that ftp site supports resuming, but my vfp program always starts from beginning. Thanks.
A.M. | 2006-01-12 11:15:48
Boris,

Take a look at the InternetSetFilePointer function and code sample "Using InternetSetFilePointer when resuming interrupted download from the Internet" in this reference.
Mihai Cazac | 2006-07-31 08:10:12
Be aware that FtpGetFile() needs a Windows server to operate properly. In other words you can get the file if, and only if,  the server on wich the file is located is a Windows-based server.
Bill Coupe | 2006-07-31 09:55:44
Mihai - that's not exactly true. I'm retrieving and putting files from an IBM mainframe (3390) and several Sun Unix boxes as well (both internal and external to me). You can not however, easily retrieve file sizes prior to 'getting' the file due to differences in the file systems.
Mihai Cazac | 2006-10-29 08:59:07
You're right, Bill, it works on other machines too. Unfortunately I've had make a little (big) mistake in the call of FtpGetFile() , and , somehow , my test program failed to download a file from a linux machine, but succeeded doing the same thing from a windows one; trying to figure what is happening, I've found in MSDN  the following requirements for FtpGetFile():  Server: Requires Windows Server "Longhorn", Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0. (see http://windowssdk.msdn.microsoft.com/en-us/library/aa384157.aspx )
So I thought that this was the case, and I've made the previous post.

Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.92.141.211)
3 sec.Function: 'GdipCreateMatrix'
7 sec.Function: 'DragQueryPoint'
10 sec.Function: 'gethostname'
13 sec.Function: 'AVIStreamReadFormat'
17 sec.Function: 'InternetOpenUrl'
20 sec.Function: 'RemoveDirectoryTransacted'
24 sec.Function: 'GdipSetImageAttributesColorKeys'
28 sec.Function: 'UnlockServiceDatabase'
32 sec.Function: 'SetClipboardViewer'
35 sec.Function: 'InternetWriteFile'
Google
Advertise here!