General information
Category:
Internet applications
All,
I want to FTP some XML file to Taiwan everyday. But I get fail when doing "FtpPutFile".
What is my stort in my code?
Give me your suggestion.
***************************************************************
DECLARE Integer InternetOpen IN WinInet String @lpcAgent, Integer nAccessType, String @lpcProxyName, ;
String @lpcProxyBypass, Integer nFlags
DECLARE Integer InternetConnect IN WinInet ;
Integer nInet_Handle, String @lpcServer, Short nPort, String @cUserName, String @cPassword, Integer ;
nService, Integer nFlags, Integer nContext
DECLARE Integer FtpPutFile IN WinInet Integer FtpHandle, String @NewFile, String @RemoteFile, Integer ;
nFlags, Integer nContext
#DEFINE cNull CHR(0)
**
cHostName = "888.88.8.8" + cNull
cUserName = "ftpuser" + cNull
cPassWord = "ftpuser" + cNull
FtpAgent = "FTP Agent by me"
InternetHandle = InternetOpen((FtpAgent), 1, cNull, cNull, 0)
FtpHandle = InternetConnect(InternetHandle, (cHostName), 21, (cUserName), (cPassword), 1, 0, 0)
localFile = "c:\2.txt" + cNull
RemoteFile = "/SSIS/2.txt" + cNull
nResult = FtpPutFile(FtpHandle, @localFile, @RemoteFile, 2, 0)
IF nResult = 1
=messagebox("OK!")
else
=messagebox("Fail!")
endif
Ricky
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only