LPARAMETERS tcfiletoupload,tcftp_edv_host,tcftp_edv_userid,tcftp_edv_pw,tctransfer_acct_vendor_name
LOCAL lcfiletouploadnopath,llretval,llsuccess
&& This does an upload
lcfiletouploadnopath=JUSTFNAME(tcfiletoupload)
DECLARE INTEGER InternetOpen IN wininet;
STRING sAgent, INTEGER lAccessType,;
STRING sProxyName, STRING sProxyBypass,;
INTEGER lFlags
DECLARE INTEGER InternetCloseHandle IN wininet;
INTEGER hInet
DECLARE INTEGER InternetConnect IN wininet;
INTEGER hInternetSession,;
STRING sServerName,;
INTEGER nServerPort,;
STRING sUsername,;
STRING sPassword,;
INTEGER lService,;
INTEGER lFlags,;
INTEGER lContext
DECLARE INTEGER FtpPutFile IN wininet;
INTEGER hConnect,;
STRING lpszLocalFile,;
STRING lpszNewRemoteFile,;
INTEGER dwFlags,;
INTEGER dwContext
hInternet = InternetOpen("ITFFtp", 1, 0,0,0)
&& 02/15/2017 - adding code to ensure got a connection
IF ISNULL(m.hInternet) OR m.hInternet = 0
&&llretval= InternetCloseHandle(m.hInternet)
CLEAR DLLS "InternetOpen"
CLEAR DLLS "InternetConnect"
CLEAR DLLS "FtpPutFile"
CLEAR DLLS "InternetCloseHandle"
RELEASE hInternet
RETURN .f.
ENDIF
DO CASE
CASE tctransfer_acct_vendor_name=="TOUCHPAY"
hConnection = InternetConnect(m.hInternet, tcftp_edv_host,;
0,;
tcftp_edv_userid, tcftp_edv_pw, 1, 0x08000000, 0)
lcfiletouploadnopath="./inmates/"+ALLTRIM(lcfiletouploadnopath)
CASE tctransfer_acct_vendor_name=="IFS"
hConnection = InternetConnect(m.hInternet, tcftp_edv_host,;
24160,;
tcftp_edv_userid, tcftp_edv_pw, 1, 0x08000000, 0)
lcfiletouploadnopath="./Riverbend/Inbox/"+ALLTRIM(lcfiletouploadnopath)
CASE tctransfer_acct_vendor_name=="JPAY"
hConnection = InternetConnect(m.hInternet, tcftp_edv_host,;
0,;
tcftp_edv_userid, tcftp_edv_pw, 1, 0x08000000, 0)
ENDCASE
&& 02/15/2017 - adding code to ensure got a connection
IF ISNULL(m.hConnection) OR m.hConnection = 0
llretval= InternetCloseHandle(m.hInternet)
&&llretval= InternetCloseHandle(m.hConnection)
CLEAR DLLS "InternetOpen"
CLEAR DLLS "InternetConnect"
CLEAR DLLS "FtpPutFile"
CLEAR DLLS "InternetCloseHandle"
RELEASE hInternet
RELEASE hConnection
RETURN .f.
ENDIF
IF FtpPutFile(m.hConnection, tcfiletoupload, lcfiletouploadnopath,;
1, 0) = 0
llsuccess=.f.
ELSE
llsuccess=.t.
ENDIF
llretval= InternetCloseHandle(m.hConnection)
llretval= InternetCloseHandle(m.hInternet)
CLEAR DLLS "InternetOpen"
CLEAR DLLS "InternetConnect"
CLEAR DLLS "FtpPutFile"
CLEAR DLLS "InternetCloseHandle"
RELEASE hInternet
RELEASE hConnection
RETURN llsuccess