Ftp transfer

Discussion about Code Builder Builder and Winlog language support.
Post Reply
user1

Ftp transfer

Post by user1 »

I had two PCs.
One PC have winlog and visualbasic program.
Visual basic program create daily excel sheet.
The other PC have winlog only.
I need to transfer the daily excel sheet from the first PC to the second one using winlog FTP.
Please, tell us if it is possible (example for doing that).
Lorenzo
Posts: 11
Joined: Tue Nov 17, 2009 3:52 pm

Re: Ftp transfer

Post by Lorenzo »

Here it is a sample code to tranfer a file via FTP with Winlog Code:

Function bool SendFTPFile()
//********************************************************************

string SourceFullPathFileName;
string DestFullPathFileName;
string FTPHost;
int Handle;


//**********************************
// Send a file in FTP mode.
//**********************************
FTPHost="1.2.3.4";
Handle=FTPConnect(21, // Gate for FTP file transfer
FTPHost, // Host
"SUserName", // Username to access FTP area
"Password", // Password to access FTP area
true, // Passive mode
10000); // Timeout
if (Handle>=0) then
DestFullPathFileName="/ftpGateway/MyFile.txt";
SourceFullPathFileName="C:\MyFile.txt";
FTPPut(Handle,SourceFullPathFileName,DestFullPathFileName ,1);
end
FTPDisconnect(Handle);
end

You can download application here:
viewtopic.php?f=20&t=73
Post Reply