Re: Dealing with Mac files
| From: | Brian 'Bex' Huff | Date: | Fri, 13 Dec 2002 18:58:57 +0000 |
| Subject: | Re: Dealing with Mac files | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-17402@lists.php.net to get a copy of this message | ||
2 things to note about Mac files... some browsers (IE) intermittently perform a MacBinary encoding of the file, and neglect to inform the server application. The data will be unparsable until decoded. You will need to first do a check to see if the file is MacBinary, and then execute some kind of utility to decode it on your Windows / Unix server. There's a few utilities available:
http://download.com.com/3120-20-0.html?qt=macbinary&tg=dl-2001
Second, the end-of-line character on the mac is just '\r', as opposed to '\r\n' on windows, and '\n' on Unix... it looks like you already found this out... so a lot of the useful PHP utility functions may not work well. You may be stuck using 'fopen' and 'fgets' to parse the file:
http://www.php.net/manual/en/function.fgets.php
--
Brian 'Bex' Huff
bex@stellent.com
Phone: 952-903-2023
Fax: 952-829-5424