Gerald Winkler wrote:
<snip>
The code for the fopen is specifying a binary d/l and not ASCII so it shouldn't be doing this...
</snip>

...Or should it?..

<snip>
Oh, it was originally tested using some .xls files, but a few .txt files I
created as a test were altered in the d/l as well...
</snip>

It works with the .xls files, but not with the .txt file correct?

.xls files are binary, .txt files are ASCII

To open the .txt file try one of these instead
$fd = fopen($filepath,'r');
or
$fd = fopen($filepath,'rt');


Of course another infamous snip from the manual...
http://www.php.net/fopen
<snip>
The default translation mode depends on the SAPI and version of PHP that you are using, so you are encouraged to always specify the appropriate flag for portability reasons. You should use the 't' mode if you are working with plain-text files and you use \n to delimit your line endings in your script, but expect your files to be readable with applications such as notepad. You should use the 'b' in all other cases.
</snip>


Hope that helps. Sorry if I misunderstood your problem.

--
Chris Martin
Web Developer
Open Source & Web Standards Advocate
http://www.chriscodes.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to