Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
*... ftpPut.prg ...
PARAMETERS lcHost, lcUser, lcPassword, lcSource, lcTarget
*... Usage: DO ftpput WITH ;
*... 'ftp.host', 'name', 'password', 'source.file', 'target.file'
#DEFINE XFER_ASCII 1
#DEFINE XFER_BINARY 2
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 FtpPutFile IN wininet.DLL;
INTEGER hConnect,;
STRING lpszLocalFile,;
STRING lpszNewRemoteFile,;
INTEGER dwFlags,;
INTEGER dwContext
PUBLIC hOpen, hFtpSession
lcHost = ALLTRIM(lcHost)
lcUser = ALLTRIM(lcUser)
lcPassword = ALLTRIM(lcPassword)
lcSource = ALLTRIM(lcSource)
lcTarget = ALLTRIM(lcTarget)
IF connect2ftp (lcHost, lcUser, lcPassword)
IF FtpPutFile (hFtpSession, lcSource,;
lcTarget, XFER_ASCII, 0) = 1
?'File transferred.'
ENDIF
= InternetCloseHandle (hFtpSession)
= InternetCloseHandle (hOpen)
ENDIF
FUNCTION connect2ftp (strHost, strUser, strPwd)
hOpen = InternetOpen ("vfp", 1, 0, 0, 0)
IF hOpen = 0
? "Unable to get access to WinInet.Dll"
RETURN .F.
ENDIF
hFtpSession = InternetConnect (hOpen, strHost, 0,;
strUser, strPwd, 1, 0, 0) &&... 1 = ftp
IF hFtpSession = 0
* close Inet and exit
= InternetCloseHandle (hOpen)
? "FTP " + strHost + " is not available"
RETURN .F.
ELSE
? "Connected to " + strHost
ENDIF
RETURN .T.
DECLARE INTEGER
tpPutFile IN wininet.DLL;
INTEGER hConnect,;
STRING lpszLocalFile,;
STRING lpszNewRemoteFile,;
INTEGER dwFlags,;
INTEGER dwContext
to this:
DECLARE INTEGER
tpPutFile IN wininet.DLL;
INTEGER hConnect,;
STRING lpszLocalFile,;
STRING lpszNewRemoteFile,;
INTEGER dwFlags,;
INTEGER dwContext
And this:
IF
tpPutFile (hftpSession, lcSource,;
lcTarget, XFER_ASCII, 0) = 1
?'File transferred.'
ENDIF
to this:
IF
tpPutFile (hftpSession, lcSource,;
lcTarget, XFER_ASCII, 0) = 1
?'File transferred.'
ENDIF
*... ftpPut.prg ...
PARAMETERS lcHost, lcUser, lcPassword, lcSource, lcTarget
*... Usage: DO ftpput WITH ;
*... 'ftp.host', 'name', 'password', 'source.file', 'target.file'
#DEFINE XFER_ASCII 1
#DEFINE XFER_BINARY 2
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 FtpPutFile IN wininet.DLL;
INTEGER hConnect,;
STRING lpszLocalFile,;
STRING lpszNewRemoteFile,;
INTEGER dwFlags,;
INTEGER dwContext
PUBLIC hOpen, hftpSession
lcHost = ALLTRIM(lcHost)
lcUser = ALLTRIM(lcUser)
lcPassword = ALLTRIM(lcPassword)
lcSource = ALLTRIM(lcSource)
lcTarget = ALLTRIM(lcTarget)
IF connect2ftp (lcHost, lcUser, lcPassword)
IF FtpPutFile (hftpSession, lcSource,;
lcTarget, XFER_ASCII, 0) = 1
?'File transferred.'
ENDIF
= InternetCloseHandle (hftpSession)
= InternetCloseHandle (hOpen)
ENDIF
FUNCTION connect2ftp (strHost, strUser, strPwd)
hOpen = InternetOpen ("vfp", 1, 0, 0, 0)
IF hOpen = 0
? "Unable to get access to WinInet.Dll"
RETURN .F.
ENDIF
hftpSession = InternetConnect (hOpen, strHost, 0,;
strUser, strPwd, 1, 0, 0) &&... 1 = ftp
IF hftpSession = 0
* close Inet and exit
= InternetCloseHandle (hOpen)
? "ftp " + strHost + " is not available"
RETURN .F.
ELSE
? "Connected to " + strHost
ENDIF
RETURN .T.