Hello,
i would like to add a progress bar indicated bytes donwloaded but i unknow variable for that.
I use DownloadFile() command to download.
I have read hurl doc and found #CURLINFO_SIZE_DOWNLOADED but don't work...
Do you have a simple example please ?
Thanks a lot !
Progressbar for download file
Re: Progressbar for download file
i must obligatory open a hurl session with e = hurl.Easy() to get variable with GetInfoContent_Lengh_Download_t() ?
- airsoftsoftwair
- Posts: 5450
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Progressbar for download file
You can pass a callback function to DownloadFile() which will be called repeatedly while downloading is in progress so this callback could be used to update a progress bar.
Re: Progressbar for download file
Here is an example. The password has yet to be inserted.
Code: Select all
Function ProgressBar(msg)
DebugPrint(ToString(Int(msg.Count/msg.Total*100)).."%")
Return(False)
EndFunction
passw$="" ; get the password from here: https://dlptest.com/ftp-test/
For i=1 To 2^14 ; 16k random characters
data$=data$.. Chr(32+Rnd(93))
Next
UploadFile ("ftp://dlpuser:"..passw$.."@ftp.dlptest.com/test.bin", {Data = data$})
DownloadFile("ftp://dlpuser:"..passw$.."@ftp.dlptest.com/test.bin", {File = "test.txt"},ProgressBar)
Re: Progressbar for download file
Thanks a lot Flink!
With help of your example my code work now!
With help of your example my code work now!