Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FtpFileOpen doesn't work.
Message
De
01/12/2000 15:02:56
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00447008
Message ID:
00448292
Vues:
13
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform