How can i add progress bar for InetFTP transfer?
Printable View
How can i add progress bar for InetFTP transfer?
Not sure you can without resorting to the various FTP and Internet APIs
Not with Inet. Inet is easier but not very effecient for doing other things associated with downloading. Using Inet you must wait until the entire file(s) download before you can continue on. Too late for a progressbar.
To make an accurate progressbar you need to know the total length of all files and you need to obtain this before you do any downloading. Then the downloading process must return the number of bytes transmitted at various time points so you can move your progressbar accordingly. To do this the download process must be interruptable and Inet is not interruptable; neither is FTP.EXE.
The only way I know to do this is to use Winsock. Do you really want to switch over to Winsock?
i dont have any idea with winsock. will it work even if the client and server are located remotely to each other?
It could help to understand about winsock -->
http://www.devx.com/vb2themax/Article/19879
I use INET control to transfer files and while they are transfering I 'play' a gif file simulating an endless progress bar
JG
i dunno if winsock will be applicable on what im doing right now. Can it transfer file to pc that is not connected on the same network?
In terms of a LAN, it can, if there's a suitable Bridge between the two LANs.
In terms of The Internet, yes, as long as Port Forwarding, Firewalls, Proxys etc. are set up to allow access. If you're trying to use Inet then I'm assuming you're accessing files on The Internet, and as it's FTP there's a good possibility that the Server has the necessary security in place.
how about the speed of transfer? winsock or Inet?
I would think Winsock would be the fastest since there's less 'overhead' code. Inet is a wrapper for some of the Internet APIs which eventually use a socket to transfer data, whereas you'd be using a Socket directly. However, as with all these things, it depends upon the efficiency of the code you write. :)
BTW there's one or two examples of FTP in the VB6 CodeBank
if you use a shell object for file transfer it works asyncronously, code continues without waiting for download, also shows it's own progressbar, but if you are waiting for a downloaded file your code needs to loop until downloading completes
search in this forum on shell ftp , there are a few examples, if you want to try it out