|
-
May 29th, 2011, 09:55 PM
#1
Thread Starter
Hyperactive Member
InetFTP
How can i add progress bar for InetFTP transfer?
-
May 30th, 2011, 03:09 AM
#2
Re: InetFTP
Not sure you can without resorting to the various FTP and Internet APIs
-
May 30th, 2011, 03:28 PM
#3
Re: InetFTP
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?
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
May 31st, 2011, 12:05 AM
#4
Thread Starter
Hyperactive Member
Re: InetFTP
i dont have any idea with winsock. will it work even if the client and server are located remotely to each other?
-
May 31st, 2011, 01:01 AM
#5
Re: InetFTP
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
-
May 31st, 2011, 01:39 AM
#6
Thread Starter
Hyperactive Member
Re: InetFTP
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?
-
May 31st, 2011, 01:48 AM
#7
Re: InetFTP
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.
-
May 31st, 2011, 02:09 AM
#8
Thread Starter
Hyperactive Member
Re: InetFTP
how about the speed of transfer? winsock or Inet?
-
May 31st, 2011, 02:16 AM
#9
Re: InetFTP
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
-
May 31st, 2011, 04:30 AM
#10
Re: InetFTP
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
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|