When I used to use CURLSMBS individually in threads, the Progress event would fire pretty frequently and I could display a smooth and informative ProgressBar. Using CURLSMultiMBS.SharedInstance (which I love), however, it doesn’t seem to fire until the transfer is complete when using the default buffer size. I can get it to fire more frequently by setting OptionBufferSize to a small value, but that seems to slow down the transfer unnecessarily and results in the bar moving in uniform increments that don’t seem “real”.
Don’t know if this is a limitation of the CURLS library or if it could be improved in the plugin. Maybe the SharedInstance could have its own Progress event…
Could you log debug messages from that transfer with times, so you see what happens when.
Sometime the download is quick, but the server needs a second to connect and to find the data. So time to connect and query is long and download is short.
This is true, but if that’s the case then why is it firing with no change to dlTotal and dlNow? It should fire only when actual progress has occurred, no?
So we can live process debug messages and show them.
As well as show the progress.
I had to limit progress to actually get a meaningful progress as this would otherwise run much to quickly!
Public Sub DownloadOneURL()
If UBound(urls) = -1 Then Return
Dim URL As String = URLs.Pop
Dim c As New MyCURLSMBS
// setup request and any options you need
c.OptionURL = URL
c.OptionUserAgent = "MyDownloader 1.0"
c.OptionMaxRecvSpeed = 2000
If CURLSMultiMBS.SharedInstance.AddCURL(c, AddressOf TransferFinished) Then
Log "Downloading: "+URL
else
Break
end if
End Sub
I just recently ran into a very similar issue with URLConnection’s data received event having useless parameter values. It turned out that Xojo was adding a header to ask for compressed response and this was borking the framework.
This could explain why it works for some tests, but not your use case (the URL / response is different).
It’s an Amazon S3 bucket. The URL is just “ftp.myclient.com” and somehow it automagically selects the target “directory” based on the username - I don’t really understand the details, but for sure it’s SFTP - I don’t think S3 even supports FTP.
@Christian_Schmitz sent me his sample project but there’s no magic there, it’s the same as what I do except that I’m using SFTP instead of his http download.
I know my file is small and only takes a few seconds to download, but it’d be nice to have a progressbar even if it goes quickly. I guess I’ll have to use a wheel, ugh.