I have found follow sample on xharbour ng corrected by ron
#include "common.ch"
#include "Directry.ch"
Function main()
Donwload_File("www/atualiza/sagi/
res","curiosidades.doc","curiosidades.doc")
Return
***********************************************
Function Donwload_File(ftpdir,ftpfile,fdestino)
***********************************************
ftpproto ="ftp://"
ftpserver = 'ftp.myweb.com.br/' <-- the last / is required on the on
ftp server address. also, id you ness to pass other ftp folder do
ftp.myweb.com.br/folder/
ftpuser = 'user'
ftppass = 'password'
oUrl:= turl():new(ftpproto+ftpuser+":"+ftppass+"@"+ftpserver)
oCred:= tIPCredentials()
oFtp:= tipclientftp():NEW(oUrl,.T.) <-- here is your error, xharbour
1.2 tip ftp class, has only two parameters
oFTP:nConnTimeout := 20000
oFTP:bUsePasv := .T.
IF oFTP:Open()
oFTP:Cwd(ftpdir)
IF !empty(oFTP:List())
cTamanho:=oFTP:fileSize(ftpfile)
Inicia_Progress(fdestino,cTamanho,ftpfile)
ENDIF
oFTP:CLOSE()
ENDIF
Return
*************************************************
Function Inicia_Progress(fdestino,wTotal,ftpfile)
*************************************************
oFtp:exGauge := { | done, size| ShowGauge(done, size,
wTotal,ftpfile ) }
oFtp:DownLoadFile(fdestino)
****************************************************
Procedure ShowGauge( nSent, nSize, wTotal, ftpfile )
****************************************************
IF nSent > 0
@ 10,10 say "Arquivo...: " +ftpfile+" "+ STR(nSent)+" Byts de: " +
str(wTotal)+ " Byts "+str((nSent/wTotal)*100,4) +" %"
ENDIF
RETURN
2009/5/24 Itamar Lins <[email protected]>:
> Hi!
> I get problem with FTP
> Before works of 2009-05-12 09:25 UTC+0200 Viktor Szakats, works fine.
> But now show this error. :-(
> I am using filezilla serverftp.
>
> (000018) 24/5/2009 16:25:20 - integrator (189.105.11.186)> 230 Logged on
> (000018) 24/5/2009 16:25:20 - integrator (189.105.11.186)> TYPE I
> (000018) 24/5/2009 16:25:20 - integrator (189.105.11.186)> 200 Type set to I
> (000018) 24/5/2009 16:25:21 - integrator (189.105.11.186)> CWD
> 05372927000176
> (000018) 24/5/2009 16:25:21 - integrator (189.105.11.186)> 250 CWD
> successful. "/05372927000176" is current directory.
> (000018) 24/5/2009 16:25:21 - integrator (189.105.11.186)> PASV
> (000018) 24/5/2009 16:25:21 - integrator (189.105.11.186)> 227 Entering
> Passive Mode (189,104,69,146,14,108)
> (000018) 24/5/2009 16:25:24 - integrator (189.105.11.186)> STOR estoque.dbf
> (000019) 24/5/2009 16:25:28 - (not logged in) (189.105.11.186)> Connected,
> sending welcome message...
> (000019) 24/5/2009 16:25:28 - (not logged in) (189.105.11.186)> 220 Bem
> Vindo ao Servidor FTP
> (000019) 24/5/2009 16:25:28 - (not logged in) (189.105.11.186)> could not
> send reply, disconnected.
> (000018) 24/5/2009 16:25:32 - integrator (189.105.11.186)> 425 Can't open
> data connection.
> (000018) 24/5/2009 16:25:43 - integrator (189.105.11.186)> m ╠
> (000018) 24/5/2009 16:25:43 - integrator (189.105.11.186)> 500 Syntax error,
> command unrecognized.
> (000018) 24/5/2009 16:25:43 - integrator (189.105.11.186)>
> (000018) 24/5/2009 16:25:43 - integrator (189.105.11.186)> 500 Syntax error,
> command unrecognized.
> (000018) 24/5/2009 16:25:43 - integrator (189.105.11.186)>
> (000018) 24/5/2009 16:25:43 - integrator (189.105.11.186)> 500 Syntax error,
> command unrecognized.
>
> Via command line works fine, for example.
> ftp -i xyzmyftp.net
> mput *.dbf
>
> My piece of program is:
>
> oFTP:exGauge := { | done, size| ShowGauge(done, size,
> ArrayFile[n] ) }
> If oFTP:UpLoadFile(cFile)
>
>
> Regards,
> Itamar M. Lins Jr.
>
>
>
> _______________________________________________
> Harbour mailing list
> [email protected]
> http://lists.harbour-project.org/mailman/listinfo/harbour
>
--
Massimo Belgrano
Analisi e sviluppo software per Lan e Web - Consulenza informatica - Formazione
Delta Informatica S.r.l. http://www.deltain.it/ +39 0321 455962
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour