Bonsoir,
je veux télécharger un fichier (environ 11 Mo) sur un site web et afficher une barre de progression pendant le téléchargement.
Pour le téléchargement j'utilise le code suivant (trouvé dans le forum):
-------------------------------
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
Private Const ERROR_SUCCESS As Long = 0
Sub LancementProcedure()
DownloadFile "http://www.metrofrance.com/fr/divers/pdf/2007/11/28/FRLYO_2007_11_28.pdf", "C:\\FRLYO_2007_11_28.pdf"
End Sub
Public Function DownloadFile(ByVal sURL As String, ByVal sLocalFile As String) As Boolean
Dim lngRetVal As Long
DownloadFile = URLDownloadToFile(0&, sURL, sLocalFile, 0&, 0&) = ERROR_SUCCESS
End Function
---------------------------------
Pour la barre de progression, je suis perdu.
Si quelqu'un pouvait m'aider.
Merci.
je veux télécharger un fichier (environ 11 Mo) sur un site web et afficher une barre de progression pendant le téléchargement.
Pour le téléchargement j'utilise le code suivant (trouvé dans le forum):
-------------------------------
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
Private Const ERROR_SUCCESS As Long = 0
Sub LancementProcedure()
DownloadFile "http://www.metrofrance.com/fr/divers/pdf/2007/11/28/FRLYO_2007_11_28.pdf", "C:\\FRLYO_2007_11_28.pdf"
End Sub
Public Function DownloadFile(ByVal sURL As String, ByVal sLocalFile As String) As Boolean
Dim lngRetVal As Long
DownloadFile = URLDownloadToFile(0&, sURL, sLocalFile, 0&, 0&) = ERROR_SUCCESS
End Function
---------------------------------
Pour la barre de progression, je suis perdu.
Si quelqu'un pouvait m'aider.
Merci.