I found that the offending line was:
httpSock.SetRequestHeader("Range", "Bytes=" + format(partStart, "#") + "-")

To have it work the 'bytes' parameter must be a single string:

dim bytesStr as string
bytesStr = "Bytes=" + format(partStart, "#") + "-"
httpSock.SetRequestHeader("Range", bytesStr)

All the URLs that were problematic now work all right.

Thanks Navdeep and Joe Hubert for answering.
(Joe, my answer to you bumped back).


>From: Navdeep Bains <[EMAIL PROTECTED]>
>Date: Fri, 1 Dec 2006 21:25:10 -0800
>
>Hello,
>
>Since you're still using RB 5.5, you can use my old HTTP socket 
>class, which should resume correctly:
>http://www.bainsware.com/downloads/basichttp.sit
>
>I'm guessing that REALBasic is sending HTTP/1.0 in the request line
>(rather than 1.1), and maybe that's causing Netscape's server to 
>ignore the Range command.
>
>Thanks,
>Navdeep Bains
>Bains Software
>
>On Nov 30, 2006, at 5:03 PM, Carlo Rubini wrote:
>
> > I can usually resume interrupted downloads sending the following code:
> >
> >   httpSock.SetRequestHeader("User-Agent", safariAgent)
> >   httpSock.SetRequestHeader("Range", "Bytes=" + format(partStart, 
> > "#") + "-")
> >   httpSock.Get(theURL)
> >
> > Yet I fail to resume download of some URLs. For instance, after 
> > downloading 500K from
> > http://www.eudora.com/download/eudora/mac/6.2.4/Eudora_6.2.4_OSX.hqx
> >
> > if I stop the process and try to download the remaining part, I get 
> > a httpStatus of 200 and the headers show like this:
> >
> > Server: Netscape-Enterprise/6.0
> > Date: Fri, 01 Dec 2006 00:50:38 GMT
> > Content-type: application/mac-binhex40
> > Last-modified: Thu, 05 Oct 2006 18:45:05 GMT
> > Content-length: 12995340
> > Accept-ranges: bytes
> > Connection: close
> >
> > As can be seen, there is no Content-Range header, as usually 
> > happens when resuming an interrupted download.
> > As a consequence, what gets added to the partially downloaded file 
> > is the whole content, not 500-12995340/12995340 as expected.
> >
> > Yet, Safari can succesfully resume the interrupted download of this 
> > same URL.
> >
> > Mac OS 10.4.4  RB 5.5.5
> >
> > Any suggestion more than welcome,
-- 
Carlo
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to