Dim taille As Variant 
Dim pourcent As Integer 
Dim fic_source, fic_destination As String 
 
 
fic_source = "c:\2.bmp" 'fichier a uploader" 
fic_destination = "fichier" 'fichier de destination" 
pb.Min = 0 
pb.Max = FileLen(fic_source) 
With Inet1 
.protocol = icFTP 'declaration protocole 
.URL = "ftp://81.249.XXX.XX" 'le ftp 
.username = "*****" 
.password = "*****" 
End With 
 
 
Inet1.Execute , "put " & fic_source & " /" & fic_destination 'envoie du 
fichier 
 
 
Inet2.URL = Inet1.URL 'initialise inet2 : mm url 
Inet2.username = Inet1.username 'initialise inet2 : mm username 
Inet2.password = Inet1.password 'initialise inet2 : mm password 
Inet2.protocol = Inet1.protocol 'initialise inet2 : mm protocol 
 
 
Do Until Inet1.StillExecuting = False 'boucle pendant le traitement de 
inet1 
On Error Resume Next 
    If Inet2.StillExecuting = False Then 'si inet2 n'est pas actif 
 
 
        Inet2.Execute , "size /" & fic_destination 'demande la taille 
du fichier sur le ftp 
        Do Until Inet2.StillExecuting = False 'boucle pendant le 
demande inet2 
        DoEvents 
        Loop 
 
 
        taille = Inet2.GetChunk(1024) 'recuperation du size dans taille 
        Do Until Inet2.StillExecuting = False 'boucle pendant le 
demande inet2 
        DoEvents 
        Loop 
 
 
       'affichage de la progressbar 
 
 
       pb.Value = taille 'affichage de l'avancement de pb 
       pourcent = (pb.Value / pb.Max) * 100 'calcul du pourcentage 
reçu 
       Label1.Caption = pourcent & "%" 'affichage du % du 
telechargement 
 
 
    End If 
Loop