For this task I wrote HTTP::Size.
In reply to Re: Determining file size over HTTP connection by brian_d_foy in thread Determining file size over HTTP connection by mellin