Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
My Ftp program
Message
From
19/03/2003 13:27:42
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
My Ftp program
Miscellaneous
Thread ID:
00767693
Message ID:
00767693
Views:
56
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
Map
View

Click here to load this message in the networking platform