RE: [PHP] Reading remote files

From: Date: Tue, 01 Sep 2009 17:38:33 +0000
Subject: RE: [PHP] Reading remote files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-297562@lists.php.net to get a copy of this message
From: Grace Shibley > Is there a way to read large (possibly 500 MB) remote files without loading > the whole file into memory? > We are trying to write a function that will return chunks of binary data > from a file on our server given a file location, specified offset and data > size. > > But, we have not been able to get around loading the whole file into memory > first. Is there a way to do this?? Are you actually having a problem with memory, or simply that you have to transfer it over a network first? Depending on the protocol used, you may be able to read it in chunks, but those chunks will still have to be copied to the computer that is reading it before it can be processed. The other option is to run a process in the computer where the file resides and only send the results over the network. Bob McConnell

« previous php.general (#297562) next »