PDA

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


monas
Apr 30th, 2001, 09:16 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.


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 upto 1024 bytes of 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.
Mona

amp
May 4th, 2001, 02:42 AM
I have a similar problem. What I want is to write directtly to a file on the FTP server.

How can I do this?