HTTPSocket error handling

I have a situation where, using cloned HTTPSockets, I am popping through an array of URLs and downloading files based on these URLs.

Several of these can be running at a time.

Each clone has an entry in a ListBox that shows progress.

Occasionally (far too often), something is stalling and the download will fail. This can result in a 0 Kb download or a partial file. For images, I can open the image and see that the bottom portion is missing.

This seems to indicate that the connection to the file was dropped before the download completed.

In the Error Event Handler of the HTTPSocket I placed code to add lines to another ListBox in the window and it doesn’t seem to be providing pertinent error information.

Unfortunately, although this is happening too often, it’s difficult to troubleshoot because it’s intermittent.

Any suggestions on how to handle this situation gracefully?

Any help would be appreciated.

the MBS CURL Plugin can do download and uploads with resumes.
Maybe that would help?

Ah…didn’t even think about that. I already have your CURL plugin and use it for FTP downloads.

I will try it and see what happens.


Christian, I’ve tried switching over to CURL and it seems to be working. Not sure if this eliminates the problem mentioned in my original post, but moving over to CURL should simplify things a little.

One question: How do I handle missing files? Do I have to parse the header info?

GetInfoResponseCode should tell you. 404 if file is missing for HTTP.

I have this working now and will eventually test the resume capabilities.