Code : Tout sélectionner
InitNetwork()
Define url$ = "https://www.ldvmultimedia.com/vdo/Mt_Baker.mp4"
Procedure GetHttFileSize(uri.s)
; Ar-S
Protected H$, S, E, taille.q
HttpRequest = HTTPRequest(#PB_HTTP_Get, uri.s)
If HttpRequest
H$ = HTTPInfo(HTTPRequest, #PB_HTTP_Headers)
S = FindString(H$, "Content-Length: ") +16
E = FindString(H$, Chr(10), S)
taille = Val(Mid (H$, S, E-S))
FinishHTTP(HTTPRequest)
Else
taille = 0
EndIf
ProcedureReturn taille
EndProcedure
Debug "la taille de "+url$ + " est de " + GetHttFileSize(url$) + octets