Click to See Complete Forum and Search --> : FTP


Monty123
April 30th, 2001, 09:05 AM
Hello

I'm implementing a small FTP program in which I want to read & write file
directly to/from ftp server.First I used FtpOpenfile function to open the file & then I
used InternetReadfile function to read the data. But problem is,InternetReadFile returns
False value.
So pls help me...
Here is my code:

abc = FtpOpenFile(hConnection,szFileRemote, GENERIC_READ, FTP_TRANSFER_TYPE_ASCII,0)

If abc <> 0 Then

'init temp string
strTemp = ""

Do

dim sReadBuffer as string * 2048

'read data...
blnRC = InternetReadFile(abc, sReadBuffer, _
Len(sReadBuffer), lngBytes)


If blnRC Then

' save the data
strTemp = strTemp & Left(strBuffer, lngBytes)

'check eof (lngBytes = 0)
If lngBytes = 0 Then

'file's complete...send back the data
read = strTemp
End If
End If
Loop
End If


pls help me..
thx.
Monty