DownloadFilefromURL

  • Thread starter Thread starter a
  • Start date Start date
A

a

thank you
for your help
Ido that for many times but not work
Private Sub command_1_click()
Dim mypath As String
mypath = Application.CurrentProject.Path & "\1.jpg"
DownloadFilefromURL "any web site here ", mypath
End Sub

I don't know the reason?
 
thank you
for your help
Ido that for many times but not work
Private Sub command_1_click()
Dim mypath As String
mypath = Application.CurrentProject.Path & "\1.jpg"
DownloadFilefromURL "any web site here ", mypath
End Sub

I don't know the reason?
 
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 DownloadFilefromURL(pUrlToDownload As String,
pSaveToFilepath As String)
Call URLDownloadToFile(0, pUrlToDownload, pSaveToFilepath, 0, 0)
End Function
command_1_click
DownloadFilefromURL "any web site here ", "F:\1.jpg"
end sub

why the above code work

and this code not work? Next

command_1_click
dim mypath as string
mypath = Chr$(34) & Application.CurrentProject.Path & "\1.jpg" & Chr$(34)
DownloadFilefromURL "any web site here ", mypath
end sub

why when give expression to DownloadFilefromURL NOT WORK WHY?
 
Just because you have quotes when you define the hard-coded path doesn't
always mean you need to add them.

What happens if you try:

Private Sub command_1_click()
Dim mypath As String

mypath = Application.CurrentProject.Path & "\1.jpg"
DownloadFilefromURL "any web site here ", mypath

End Sub
 
What are you actually providing for "any web site here"?

It needs to include the http:// at the beginning.
 

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

Similar Threads

Folder Button 2
Open object in another database 9
Access 2003 Error 2749 3
forms Coding 6
no files found error 1
database exclusive use by Admin 5
storing photos in database 1
Save Macro enabled WB as w/o macro 13

Back
Top