Page 3 of 5

PostPosted: Tue Jan 23, 2007 8:56 pm
by Richard Chidiak
tftpfile() seems to bethe problem

I do not use it personnally, i use ftpgetfile and ftpputfile

Antonio ?

PostPosted: Tue Jan 23, 2007 9:29 pm
by Antonio Linares
Vilian,

Please download FWPPC again, it should be ok now

PostPosted: Wed Jan 24, 2007 6:28 pm
by vilian
Antonio,

Now it is generating the Exe, but when I try to connect it appears the following error:

Argument error
STR
Args:
[ 1] = U
stack calls:
STR(0)
INTERNETOPEN(0)
TINTERNET:NEW(0)

PostPosted: Wed Jan 24, 2007 6:36 pm
by Antonio Linares
Vilian,

Please check if you are have an InternetOpen() in your code

PostPosted: Thu Jan 25, 2007 11:23 am
by vilian
Antonio,

I do not have a InternetOpen() in my code.

PostPosted: Thu Jan 25, 2007 12:05 pm
by Antonio Linares
Vilian,

Please download FWPPC again, thanks for your feedback

PostPosted: Thu Jan 25, 2007 6:20 pm
by vilian
Antonio,

Now the message is "cannot load WinInet.dll". I looked for in the Pocket for this archive but I did not find!

thanks for help.

PostPosted: Thu Jan 25, 2007 7:03 pm
by Antonio Linares
Vilian,

Please try this:

MsgInfo( LoadLibrary( "wininet.dll" ) )

and let us know what value you get, thanks

PostPosted: Thu Jan 25, 2007 7:19 pm
by vilian
Antonio,

This value is -2017256648

PostPosted: Thu Jan 25, 2007 7:22 pm
by Antonio Linares
Vilian,

Though you get the msg "cannot load WinInet.dll", does the application work fine ?

PostPosted: Thu Jan 25, 2007 7:37 pm
by vilian
Antonio,

The execution continues, but the archive is not sent for the site.

PostPosted: Thu Jan 25, 2007 9:09 pm
by Antonio Linares
Vilian,

Could you please post the code that you are testing ? thanks

PostPosted: Fri Jan 26, 2007 12:23 pm
by vilian
Antonio,

This code is

FUNCTION EnvArqFtp(cArq)
LOCAL oInternet,oFtp,nVezes:=0,lInter:=.F.

oInternet := TInternet():New()
oFTP := TFTP():New( "ip by server", oInternet,"usr","pass" )
MandaArq(CurDir()+"\"+cArq,"/public_html/sav/"+cArq,500,oFTP)

RETURN NIL

STATIC FUNCTION MandaArq(cArquivo,cRemote,nTam,oFtp)
LOCAL n,hSource,cBuffer:=Space( 6400 ),nBufSize:=6400,oFile

IF (hSource := FOpen( cArquivo )) < 0
RETURN .F.
ELSE
cBuffer := Space( 6400 )
nBufSize := 6400
SysRefresh()

oFile := TFtpFile():New( cRemote, oFTP )
IF Empty(oFile)
RETURN .F.
ELSE
oFile:OpenWrite()
FSeek( hSource, 0, 0 )

nTotal := 0
DO WHILE ( nBytes := FRead( hSource, @cBuffer, nBufSize ) ) > 0
nFeito := oFile:Write( SubStr( cBuffer, 1, nBytes ) )
SysRefresh()
nTotal += nBytes
ENDDO
oFile:End()
FClose( hSource )
ENDIF
ENDIF

RETURN .T.

PostPosted: Mon Jan 29, 2007 1:13 pm
by Antonio Linares
Vilian,

We have tested your sample and checked these values:
MsgInfo( oFTP:hFTP )
MsgInfo( oFile:hFile )
they look ok, but InternetWriteFile() (oFile:Write()) is returning 0x87 for GetLastError(): ERROR_INVALID_PARAMETER
We don't know why it reports such value :-(

Have you tried to use FtpPutFile() instead of sending blocks ?

PostPosted: Tue Jan 30, 2007 2:06 pm
by vilian
Antonio,

I Tried to use FtpPutFile, but the system stops to answer without giving error message. You have an example of the use of this function?