PHP Classes

Large Files

Recommend this page to a friend!

      PHP HTTP protocol client  >  All threads  >  Large Files  >  (Un) Subscribe thread alerts  
Subject:Large Files
Summary:How to download (and upload) large files?
Messages:2
Author:Jim A
Date:2006-11-29 05:24:54
Update:2006-11-29 21:44:43
 

  1. Large Files   Reply   Report abuse  
Picture of Jim A Jim A - 2006-11-29 05:24:54
I am using the HTTP Protocol Client to download a large CSV file (225K). Only a small part of the file is in the response, obviously due to the buffer size.

My code is based on that in test_http.php, which has...

$error=$http->ReadReplyBody($response,1000);

I upped the size to 50000 for an 11K download, but the file was still cut off at the same place. (I also had the same problem using another PHP-based http client.) Obviously I am lacking understanding of the http protocol and how the buffering is done.

Any suggestions?

I would also like to use the client (http post) to upload some large db backup files. Will there be a problem?

Thanks!

  2. Re: Large Files   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-11-29 21:44:43 - In reply to message 1 from Jim A
You are just reading 1000 bytes. You need to repeat calling that function in a loop until the body data that it returns is an empty string. See the example scripts.