+ Reply to Thread
Results 1 to 2 of 2

Code to do a Web-download

  1. #1
    c mateland
    Guest

    Code to do a Web-download

    In an addin I employ some commonly used Web-download code as shown
    below:


    Public Function DownloadFile(sDlNetFileAddy As String, _
    sDlUserPath As String) As Boolean
    DownloadFile = URLDownloadToFile(0&, sDlNetFileAddy, _
    sDlUserPath, BINDF_GETNEWESTVERSION, 0&) = ERROR_SUCCESS
    DoEvents
    End Function


    Along with the supporting code, it works well, but my concern is for
    those people with really slow connections. I'm concerned it may cause a
    runtime error if it takes too long.

    Any thoughts on this? Is there a way I can set a timeout variable?

    Thanks,
    Chuck


  2. #2
    Robin Hammond
    Guest

    Re: Code to do a Web-download

    Chuck,

    See my last few posts and keep an eye on that thread.

    IF I can get around the problem with registering a winsock I'll post a
    solution in which you can monitor how much of the file has been downloaded.
    I have it working on one box and it's very easy to use. Likewise, part of my
    reason for doing this was a recent experience of a slow connection and an
    inability to do anything but sit there and wait for the command to finish.

    Yours,

    Robin Hammond
    www.enhanceddatasystems.com

    "c mateland" <[email protected]> wrote in message
    news:[email protected]...
    > In an addin I employ some commonly used Web-download code as shown
    > below:
    >
    >
    > Public Function DownloadFile(sDlNetFileAddy As String, _
    > sDlUserPath As String) As Boolean
    > DownloadFile = URLDownloadToFile(0&, sDlNetFileAddy, _
    > sDlUserPath, BINDF_GETNEWESTVERSION, 0&) = ERROR_SUCCESS
    > DoEvents
    > End Function
    >
    >
    > Along with the supporting code, it works well, but my concern is for
    > those people with really slow connections. I'm concerned it may cause a
    > runtime error if it takes too long.
    >
    > Any thoughts on this? Is there a way I can set a timeout variable?
    >
    > Thanks,
    > Chuck
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1