Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 513207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:23:55+00:00 2026-05-13T07:23:55+00:00

Does anyone know how to download a file (without opening a webpage), and save

  • 0

Does anyone know how to download a file (without opening a webpage), and save it to a directory in Visual Basic 6.0?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:23:56+00:00Added an answer on May 13, 2026 at 7:23 am

    If you want to do it with code only (no Internet Transfer Control), VBNet.mvps.org has a really good how-to article that uses the URLDownloadToFile API call.

    From the article:

    The URLDownloadToFile API is available
    on all versions of the Windows
    operating system (except Win3,
    WinNT3.x). By passing the remote file
    name and the local file path and name,
    the API downloads the bits of the
    specified file saving them as the
    target name. The function works with
    all file types – plain text, images,
    html, mpg, wav and zip files etc.
    without modification to the routine or
    concern for the file being downloaded,
    nor is there any apparent size
    restriction or limitation.

    Private Declare Function URLDownloadToFile Lib "urlmon" _
       Alias "URLDownloadToFileA" _
      (ByVal pCaller As Long, _
       ByVal szURL As String, _
       ByVal szFileName As String, _
       ByVal dwReserved As Long, _
       ByVal lpfnCB As Long) As Long
    
    Private Const ERROR_SUCCESS As Long = 0
    Private Const BINDF_GETNEWESTVERSION As Long = &H10
    Private Const INTERNET_FLAG_RELOAD As Long = &H80000000
    
    Public Function DownloadFile(sSourceUrl As String, _
                                 sLocalFile As String) As Boolean
    
      //'Download the file. BINDF_GETNEWESTVERSION forces 
      //'the API to download from the specified source. 
      //'Passing 0& as dwReserved causes the locally-cached 
      //'copy to be downloaded, if available. If the API 
      //'returns ERROR_SUCCESS (0), DownloadFile returns True.
       DownloadFile = URLDownloadToFile(0&, _
                                        sSourceUrl, _
                                        sLocalFile, _
                                        BINDF_GETNEWESTVERSION, _
                                        0&) = ERROR_SUCCESS
    
    End Function
    

    FYI – in testing on Windows 7, it would only return the cached version, so I had to use the extra function mentioned in the article to clear it first (and that worked).

    Private Declare Function DeleteUrlCacheEntry Lib "Wininet.dll" _
       Alias "DeleteUrlCacheEntryA" _
      (ByVal lpszUrlName As String) As Long
    

    Then just call the above function with the destination URL first, to clear the cache.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of a way to download a file in appMobi? I have
does anyone know where I can download this zip file called businessdays.zip which was
Does anyone know where to download a vector file of Google's green android robot?
Does anyone know how to download the Azure diagnostic logs? From the control panel,
Does anyone know how to take a screencap and download it to desktop in
Does anyone know if it is possible to download the latest robocopy for Windows
Does anyone know of a free tool, similar to what is built into Visual
Does anyone know how I can open an attachment from a work item without
Does anyone know where I can download iOS version 3.1.3? I've been searching on
does anyone know what i might have to change (permissions on a particular file;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.