Results 1 to 6 of 6

Thread: [RESOLVED] Download Image Automatically

  1. #1

    Thread Starter
    Junior Member TheMinime's Avatar
    Join Date
    Dec 2005
    Posts
    27

    Resolved [RESOLVED] Download Image Automatically

    How can I Get an image Automatically from any website using code, without opening the browser.

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Download Image Automatically

    you will need the path to the image...

    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.     DownloadFile "http://www.url.com/etc/etc/test.txt", "C:\Test.txt"
    11.     If Len(Dir("C:\Test.txt")) <> 0 Then MsgBox "Success!"
    12. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Junior Member TheMinime's Avatar
    Join Date
    Dec 2005
    Posts
    27

    Re: Download Image Automatically

    I am trying to download Image from a website using code, any suggestions please?

  4. #4

    Thread Starter
    Junior Member TheMinime's Avatar
    Join Date
    Dec 2005
    Posts
    27

    Re: Download Image Automatically

    I see that u r a dynamic not a static , how fast r u . . .

    Thnx man a lot I appreciate it.

  5. #5
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Download Image Automatically

    TheMinime..
    first of all.. Welcome o the forums! (I just noticed this was your first post)
    I have 2 suggestions for u though..

    1) please be a little more patient.. 3 minutes between original post and bump post is too short.. although this is the best place (and the fastest ) to get anwsers...sometimes it takes a little while for someone to reply..

    2) if this is resolved.. please go to the top of the page (Above your first post) and click thread tools.. then Mark Thread resolved

    Thanks!!!!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  6. #6

    Thread Starter
    Junior Member TheMinime's Avatar
    Join Date
    Dec 2005
    Posts
    27

    Re: Download Image Automatically

    Dear Static,

    Thank you for the code it's resolved, and thank you for ur suggestions.
    if anyone u know needs help in any web application please tell me, I am a web developer.

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