Results 1 to 5 of 5

Thread: FTP/HTTP or something else

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879

    Unhappy

    If I want to download a file from the internet, What controls do I use and please post the code to use with them.

    If I want to upload afile from the internet, What controls do I use and please post the code to use with them.
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  2. #2
    Guest
    To download a file from the Internet with IE, use the DoFileDownload api function:

    Code:
    Private Declare Function DoFileDownload _
    Lib "shdocvw.dll" (ByVal lpszFile As _
    String) As Long
    
    Private Sub Command1_Click()
    
       Dim sDownload As String
    
       sDownload = StrConv("http://www.site.com/downloads/file.zip", vbUnicode)
       Call DoFileDownload(sDownload)
    
    End Sub

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879
    what if I want it to download a file without anyone seing that stupid window!
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  4. #4
    Guest
    You can use the URLDownloadToFile api function to do this.

    Code:
    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
    
    Public Function DownloadFile(URL As String, _
        LocalFilename As String) As Boolean
    
        Dim lngRetVal As Long
        
        lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
        
        If lngRetVal = 0 Then DownloadFile = True
    
    End Function
    
    
    Usage
    
    MsgBox DownloadFile("http://www.vb-world.net", "c:\vbworld.htm")

  5. #5
    New Member
    Join Date
    Apr 2001
    Location
    Malayisa
    Posts
    7
    DId you have this problem use the recommended coding for background downloading file from internet to local drive.
    Error message as follow:-
    " can't find DLL entry point URLdownloadtofile in urlmon"
    Anyone have similar problom and how to solve it.
    My operating system is windows2000, did this windows related problem?

    Thanks

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