in reply to Re: Read part of a file over FTP
in thread Read part of a file over FTP
Yes, this is what I wanted! Thanks very much!
As a follow up question, the buffer now returns the first file in my loop, and I get the text that I want, but fails on the second with the error: Can't call method "read" on an undefined value. However, I have verified that the new filename is correct, so I assume that there must be some problem with reinitializing the dataconn object?
Is there a recommended way to clear a retr() so that a new one can be called? Or is that not even likely to be my problem?
Relevant code is below: The while loop is on a MySQL query return. Note that I haven't done anything with the buffer yet.while (@results = $filequery->fetchrow()) { $filename="/".$filename; print "$filename\n"; $xfr = $ftp->retr($filename); $xfr->read($header,1400); print "$header\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Read part of a file over FTP
by ronin78 (Novice) on May 27, 2011 at 19:32 UTC | |
by BrowserUk (Patriarch) on May 27, 2011 at 19:41 UTC | |
by ronin78 (Novice) on May 27, 2011 at 19:52 UTC |