note 39586 rejected from function.ftp-fget by didou
| From: | didou@php.net | Date: | Tue, 03 Feb 2004 09:35:03 +0000 |
| Subject: | note 39586 rejected from function.ftp-fget by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-64591@lists.php.net to get a copy of this message | ||
Note Submitter: marcelmolenaar@hotmail.com
----
Beware of this:
$answerfile = fopen("D:/mydir/txt.txt", "wt");
ftp_fget($conn_id,$answerfile,"txt.txt",FTP_ASCII)
Setting the fopen mode to "wt" leads to unexpected behaviour of the ftp_fget function (in
my case on a win2000 platform).
I was transferring a textfile with 2 lines in it.... in the answerfile the two lines were put behind
eachother so no lineending anymore...
Instead of setting fopen mode to "wt" just use "w". That fixed the problem.