DownloadFile

A

a

rivate 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
Dim myjpg as string

Public Function DownloadFile(ByVal strURL As String, ByVal strLocalFilename
As String) As Long
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, strURL & vbNullChar, strLocalFilename &
vbNullChar, 0, 0)
DownloadFile = lngRetVal
End Function

Command_1_click
myjpg = Application.CurrentProject.Path & "\" & Filename &".jbg"
Call DownloadFile("URL I want to download from here ", myjpg )
End sub

Hi all my friends
I search on the net i find this code to download image jbg from web site
this code have an error I don't know?
this error my duplicate the image
what i mean by duplicate i mean the image take the name i give but not the
image on the web site
is there any wrong in this code
any comments notes
thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top