|
From: <php...@li...> - 2010-02-08 17:35:22
|
> Yes, "mostly", indeed. The code you have posted doesn't work on any > operating system or HTTP server. I am very aware that you are much more experienced in these matters than me, but your statement does not explain why the code successfully downloaded about 2.6GB of data consisting of 25-30 different files in testing yesterday. Experiences like this imply that it does work. Though I accept that it might not be the most efficient way of doing it and I'm happy to accept the advice of people who have more knowledge than me and can help me to see better solutions. I did see this when I was reading back to look again at Peter's code: > If the data you receive is encoded in HTTP/1.1 chunks, your fgets() is > incorrect, too. The HTTP/1.1 chunk data format is: Received data isn't chunk encoded. Maybe I've not been clear on this point by using the words 'chunk download' in a comment. It was my figure of speech, rather than a declaration of intent to use chunk encoding. Perhaps 'buffer download' would've been more appropriate. > Peter > has already posted code which works To my inexperienced eye, this looks like it will receive chunk encoded data, but the server I'm using is not passing data using this method. Though I do appreciate Peter's response - I don't think I acknowledged it at the time (Cheers Peter!). To me, it seems that you believe I am receiving chunk encoded data but I'm not. I can see that my code would be completely wrong if I was trying to do that and your comments about the code would be completely valid. Your frustration that I've not understood this point is clear from the last two emails. However, advice from StackOverflow confirms that my code should work fine, that fread() should be used to make it more binary-safe, that CURL would be even better, and chunk encoding is not needed. So I have other approaches to try. Thanks again for taking the time out to reply. I don't think this needs to be discussed further either. And many thanks for providing libraries without which I would not have been able to proceed as far with this project as I have. Regards, Mark... |