Results 1 to 3 of 3

Thread: Saving Internet Files

  1. #1

    Thread Starter
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961

    Saving Internet Files

    hi all,

    i have got a hyperlink:

    for eg: www.mywebsite.com/data/showdata.asp?code=999

    i want to open this page programatically and save it to my local harddisk.

    pls guide me, how to do that.

    regards and thanx in advance.


    prakash

  2. #2
    Fanatic Member
    Join Date
    Jul 2001
    Location
    London UK
    Posts
    671
    I would just use a little VB App as below...

    VB Code:
    1. 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
    2.  
    3. Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
    4.     Dim lngRetVal As Long
    5.     lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
    6.     If lngRetVal = 0 Then DownloadFile = True
    7. End Function
    8.  
    9. Private Sub Form_Load()
    10.     'example by Matthew Gates ([email protected])
    11.     DownloadFile "www.mywebsite.com/data/showdata.asp?code=999", "c:\YourFile.htm"
    12. End Sub

  3. #3

    Thread Starter
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961
    thanx smith,

    but what if the file is not available on the server??

    regards

    prakash

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