FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Help: getting updates from a remote server.
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Help: getting updates from a remote server.
Posted: Tue Oct 21, 2008 06:15 AM

I'm having my first steps with FiveWin / xHarbour. :oops:
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 ?

Posts: 15
Joined: Mon Sep 29, 2008 01:41 PM
Re: Help: getting updates from a remote server.
Posted: Tue Oct 21, 2008 09:42 AM
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 ?


you can use tftp class to get files.
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Re: Help: getting updates from a remote server.
Posted: Tue Oct 21, 2008 11:05 AM
HunterEC wrote:Is there is a way that they can download their data (if entitled to, subscription based) automatically ?

In addition to tftp you can even use tWebClient and the IE-ActiveX to retrieve remotely hosted files.
Regards,
Davide
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Help: getting updates from a remote server.
Posted: Wed Oct 22, 2008 02:26 AM

Can you post some code on how this might be done. Thanks

Harvey

Thank you

Harvey
Posts: 15
Joined: Mon Sep 29, 2008 01:41 PM
Help: getting updates from a remote server.
Posted: Wed Oct 22, 2008 03:14 AM
hag wrote:Can you post some code on how this might be done. Thanks

Harvey

              // 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
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Help: getting updates from a remote server.
Posted: Wed Oct 22, 2008 03:43 AM

Sheng:

Thanks for the data. I'll give it a try in a couple of days. Thanks again.

Harvey

Thank you

Harvey
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Help: getting updates from a remote server.
Posted: Wed Oct 22, 2008 05:28 AM

Davide, Hag, Sheng: thank you all. I'll give it a try. :D

Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Help: getting updates from a remote server.
Posted: Wed Oct 22, 2008 01:27 PM
hag wrote:Can you post some code on how this might be done.

TWebClient allows you retrieving a file via the standard http port 80. Please see \fwh\samples\webclien.prg
For the IE-ActiveX you need the most recent FWH. Antonio has posted a sample at: http://www.fivetechsoft.com/forums/viewtopic.php?t=12514
Hi,
Davide
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Help: getting updates from a remote server.
Posted: Thu Oct 23, 2008 01:08 AM

hi,
If webclient / TFTP can overwrite even if the file is open or at running ?
For example: my.exe ,my.dll,libmysql.dll are running, overwrite them besides they are running.
Under Linux ,could.

Shuming Wang

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Help: getting updates from a remote server.
Posted: Sun Oct 26, 2008 06:41 PM
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
// 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


User and pass word i understand.
What about: cFTP_IP, cServerfile what are these values?
Thank you

Harvey
Posts: 15
Joined: Mon Sep 29, 2008 01:41 PM
Help: getting updates from a remote server.
Posted: Mon Oct 27, 2008 01:40 AM
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 Code
// 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


User and pass word i understand.
What about: cFTP_IP, cServerfile what are these values?


cFtp_IP: is ftp server ip or domain name.
cServerFile: is filename at ftp server.
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Help: getting updates from a remote server.
Posted: Sat Nov 01, 2008 09:37 AM

Guys:

Thank you all for your help. I'll give it a try. :D

Continue the discussion