Results 1 to 10 of 10

Thread: InetFTP

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    InetFTP

    How can i add progress bar for InetFTP transfer?

  2. #2
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: InetFTP

    Not sure you can without resorting to the various FTP and Internet APIs

  3. #3
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    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.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    Re: InetFTP

    i dont have any idea with winsock. will it work even if the client and server are located remotely to each other?

  5. #5
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    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

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    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?

  7. #7
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    Re: InetFTP

    how about the speed of transfer? winsock or Inet?

  9. #9
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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

  10. #10
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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
  •  



Click Here to Expand Forum to Full Width