Save a file behind a hyperlink

G

George

Hello!

Starting from a hyperlink, would it be possible to save the destination file
without having to open the file?
That would be like a copy from a local path to another, but I understand
that the url doesn't work exactly like a hard drive path.

Thanks you for any suggestion and wish you a nice evening.
George
 
G

George

Thanks to Pierre (3stone) Access MVP!

Télécharger un fichier distant depuis son adresse HTTP

Syntaxe : Call Download("http://domaine/chemin/fichier.ext","F:\My
Documents\File.ext")
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

Const ERROR_SUCCESS As Long = 0
Function DownloadFile(sSourceUrl As String, sLocalFile As String) As Boolean
On Error Resume Next
Dim lngRetVal As Long
DownloadFile = URLDownloadToFile(0&, ssourceUrl, _
sLocalFile, 0&, 0&) = ERROR_SUCCESS
End Function
 

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