Help: getting updates from a remote server.
Help: getting updates from a remote server.
I'm having my first steps with FiveWin / xHarbour.
My customers need to download updated data from our servers to keep their database up to date. Is there is a way that they can download their data (if entitled to, subscription based) automatically ? Something like anti-virus software does it ? How can this be done using FiveWin ?
My customers need to download updated data from our servers to keep their database up to date. Is there is a way that they can download their data (if entitled to, subscription based) automatically ? Something like anti-virus software does it ? How can this be done using FiveWin ?
Re: Help: getting updates from a remote server.
you can use tftp class to get files.HunterEC wrote:I'm having my first steps with FiveWin / xHarbour.
My customers need to download updated data from our servers to keep their database up to date. Is there is a way that they can download their data (if entitled to, subscription based) automatically ? Something like anti-virus software does it ? How can this be done using FiveWin ?
Re: Help: getting updates from a remote server.
In addition to tftp you can even use tWebClient and the IE-ActiveX to retrieve remotely hosted files.HunterEC wrote:Is there is a way that they can download their data (if entitled to, subscription based) automatically ?
Regards,
Davide
hag wrote:Can you post some code on how this might be done. Thanks
Harvey
Code: Select all
// Create ftp connect
oFtp := TFtp():New( cFTP_IP, oInternet, cUsername, cPassword )
If oFtp:hFtp == 0
Tone( 1000, 1 )
MsgStop( "Ftp connect fail!", "Error!" )
oFtp:End()
Exit
EndIf
:
:
:
// Open remote file
oFtpFile := TFtpFile():New( cServerFile, oFtp )
oFtpFile:lBinary := .T.
//
oFtpFile:OpenRead() // Open and Read mode
If oFtpFile:nError <> 0
Tone( 1000, 1 )
MsgStop( "ftp file:["+cServerFile+"]Open & read fail!!", "Error!" )
oFtpFile:End()
lRet := .F.
Exit
EndIf
TWebClient allows you retrieving a file via the standard http port 80. Please see \fwh\samples\webclien.prghag wrote:Can you post some code on how this might be done.
For the IE-ActiveX you need the most recent FWH. Antonio has posted a sample at: http://www.fivetechsoft.com/forums/view ... hp?t=12514
Hi,
Davide
-
- Posts: 454
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
Sheng:
You posted some code here. Could you post the complete function so I can see what the values for the variables come from.
Thanks
Your Code
User and pass word i understand.
What about: cFTP_IP, cServerfile what are these values?
You posted some code here. Could you post the complete function so I can see what the values for the variables come from.
Thanks
Your Code
Code: Select all
// Create ftp connect
oFtp := TFtp():New( cFTP_IP, oInternet, cUsername, cPassword )
If oFtp:hFtp == 0
Tone( 1000, 1 )
MsgStop( "Ftp connect fail!", "Error!" )
oFtp:End()
Exit
EndIf
:
:
:
// Open remote file
oFtpFile := TFtpFile():New( cServerFile, oFtp )
oFtpFile:lBinary := .T.
//
oFtpFile:OpenRead() // Open and Read mode
If oFtpFile:nError <> 0
Tone( 1000, 1 )
MsgStop( "ftp file:["+cServerFile+"]Open & read fail!!", "Error!" )
oFtpFile:End()
lRet := .F.
Exit
EndIf
What about: cFTP_IP, cServerfile what are these values?
Thank you
Harvey
Harvey
cFtp_IP: is ftp server ip or domain name.hag wrote:Sheng:
You posted some code here. Could you post the complete function so I can see what the values for the variables come from.
Thanks
Your CodeUser and pass word i understand.Code: Select all
// Create ftp connect oFtp := TFtp():New( cFTP_IP, oInternet, cUsername, cPassword ) If oFtp:hFtp == 0 Tone( 1000, 1 ) MsgStop( "Ftp connect fail!", "Error!" ) oFtp:End() Exit EndIf : : : // Open remote file oFtpFile := TFtpFile():New( cServerFile, oFtp ) oFtpFile:lBinary := .T. // oFtpFile:OpenRead() // Open and Read mode If oFtpFile:nError <> 0 Tone( 1000, 1 ) MsgStop( "ftp file:["+cServerFile+"]Open & read fail!!", "Error!" ) oFtpFile:End() lRet := .F. Exit EndIf
What about: cFTP_IP, cServerfile what are these values?
cServerFile: is filename at ftp server.