Invoke FtpGetFile, FtpHandle, RemoteName, LocalName, TRUE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_BINARY or INTERNET_FLAG_RELOAD, 255
Posted on 2011-01-25 02:10:39 by dcskm4200
not with this function - implement the ftp protocol file transfer using simple socket so you control the datastream and you can do what you like to show progress ;)
Posted on 2011-01-25 07:31:21 by Homer
Thanks your answer.
implement the ftp protocol is some intricacy.
Using InternetSetStatusCallback to get notifications of the download progress gives you good information on how the request is progressing, including connecting status notifications. However, it does not indicate that a certain percentage of a transfer has completed.

To get the equivalent of percentage complete notifications, you need to determine the size of the transfer and then call InternetReadFile or InternetWriteFile with small buffers. Then you can calculate the percentage of the transfer as the function calls complete.

For instance, suppose you want to download a 1000 byte file. Instead of making one call to InternetReadFile with a 1000 byte buffer, you can make 10 calls to InternetReadFIle with 100 byte buffers. This way as each call to InternetReadFile completes, you know the download is another 10 percent complete.
Posted on 2011-01-25 19:55:28 by dcskm4200
I don't think ftp is a complex protocol.
I think it's less complex to write a single blocking socket function that implements  "ftp get" than it is to set up callback event handling, I don't like these api functions, not a fan at all.
Posted on 2011-01-25 21:01:41 by Homer
Homer: depends on how much you want to support. PASV + non-PASV, SSL/TLS, possibly handling server quirks... I'd personally go fo ther Internet* API, or libcurl for more elaborate needs.

No need to reinvent the wheel, especially not if making a proper round one is a fair amount of work :)
Posted on 2011-02-07 17:52:23 by f0dder