Results 1 to 9 of 9

Thread: General Questions about the MS Inet Transfer control

  1. #1
    Knele
    Guest

    General Questions about the MS Inet Transfer control

    Hello everyone!
    Being quite a newbie to Inet-programming, I got some questions to you pro-guys:
    I use the Inet control to download files from the Internet. I do this by using this function:

    Public Function Download(Location As String, Filename As String, DirToSaveTo As String)
    Dim DownloadURL As String
    DownloadURL = Location & Filename
    Dim bData() As Byte
    Dim intFile As Integer
    intFile = FreeFile()
    bData() = Inet1.OpenURL(DownloadURL, icByteArray)
    Open DirToSaveAt & "\" & Filename For Binary Access Write _
    As #intFile
    Put #intFile, , bData()
    Close #intFile
    End Function

    Now my questions are:
    1.
    Is this the best way to do it? It seemed to be the easyest, and it doesn't need tons of code...

    2.
    I want to let the user see the progress using a progress bar. For this I need to know the filesize of the File that's downloaded. How do I get this (at best using the same Inet control).

    Thanks for your help, hope I'll get some soon...

  2. #2
    rsitogp
    Guest
    Use the Microsoft Common Dialog Control, very simple to use.

  3. #3
    Knele
    Guest
    nope, this doesn't work, or I'm to stupid. I need the Dialog where I can point to the path, not a file. And I still would like to know how I get the filesize and received bytes or something like that so I can make a Progress bar.
    PLEASE HELP!!!

  4. #4
    rsitogp
    Guest
    So, make a new form, put the drive list and dir list and put an ok and cancel button, simple.

  5. #5
    Knele
    Guest
    thanks, already thought of this but believed there's a better way using standard dialogues, but this works as well...
    So what about showing the download status? Noone here who knows anything???

  6. #6
    rsitogp
    Guest
    All I know is that the size information comes in the header.

  7. #7
    Knele
    Guest
    Thanks again, but I figured a quite acceptable way to get it working with the winsock, so my problems are solved.

  8. #8
    rsitogp
    Guest
    My I ask how did you get the size with winsock?

  9. #9
    Junior Member
    Join Date
    Jan 2001
    Posts
    27

    Your Path problem

    As for your common dialog problem, why not open a Save As Dialog just before you start transferring bytes. Since you already know the file you're getting, you can set the filename property of the common dialog control to that filename. Once you click Save, the full path will be returned in the filename property. You can extract the path by using a
    Left(filename, len(filename)-len(downloadfilename)).

    Cameron

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