Hansjo wrote:

> I am having problems since upgrade from 4.2.3 to 4.3.3.
> I try to open and read a file from a remote server:
> $source = fopen(http://www.remote-server.../$remote_file,"r";);
> $content = fread($source, 500000);
> But only the first 2731 characters are read into $content by fread.
> 
> fread works correct when reading a file from local server! I have tested
> this behavior on Linux and w2k, both with apache 1.3.26
> 
> Maybe this is not th right place for my problem (?) but I am really new here
> and already have tryed to find any awnsers. So if anyone can help me or tell
> me a better place for my problem I will be really happy

The fine manual <http://de.php.net/fread> has a warning (and an example
just below that warning):

  When reading from network streams or pipes, such as those returned when
  reading remote files or from popen() and proc_open(), reading will stop
  after a packet is available. This means that you should collect the
  data together in chunks as shown in the example below.

Regards...
                Michael

Reply via email to