Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FtpFileOpen doesn't work.
Message
From
01/12/2000 15:02:56
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00447008
Message ID:
00448292
Views:
8
Use code similar to this. Update your progress bar and or labels as you go.

WITH THIS
&& Call FtpOpenFile to get the file handle
hFTPFile = .FTPOpenFileF6(.cFileNameSource)

&& llReadSuccesss set to 1 to assume success
&& hDestinationFile is a file handle using FCREATE on local drive
llReadSuccess = 1
hFTPFile = .hFTPFile
hDestinationFile = FCREATE(lcDestinationFile)
liNumBytesToRead = .nBufferSIze

DO WHILE (llReadSuccess > 0) AND (hDestinationFile > 0)

lcBuffer = SPACE(.nBufferSize)
liNumBytesRead = 0

&& InternetReadFile has a Boolean response but coming from "C" type
&& libraries the value is a 0 or 1.
llReadSuccess = InternetReadFile(hFTPFile, @lcBuffer, liNumBytesToRead,
@liNumBytesRead)

IF (llReadSuccess > 0) AND (liNumBytesRead > 0)
=FWRITE(hDestinationFile,lcBuffer)
.nBytesRead = .nBytesRead + liNumBytesRead
ENDIF
ENDDO

=FCLOSE(hDestinationFile)
ENDWITH
Terry Rooks
Software Systems Architect
Microsoft Certified Solution Developer.Net

If at first you don't succeed, then skydiving definitely isn't for you.
Previous
Reply
Map
View

Click here to load this message in the networking platform